Fixed bits for encdec and key_length. Now all tests passes.