Fix bug with AES::key ignoring the length param

It seems the last commit with this description did not really fix the issue. A 256 bit key could not be generated, but with this change it can.