Open elliotwutingfeng opened 10 months ago
According to the documentation
The paddedPlainText must be a multiple of the block size (128-bits).
However the assert statement assert(128 == paddedPlaintext.length * 8); checks if paddedPlaintext is exactly 128-bits long.
assert(128 == paddedPlaintext.length * 8);
They should be switched to assert(0 == paddedPlaintext.length % 16); (16 bytes = 128 bits)
assert(0 == paddedPlaintext.length % 16);
According to the documentation
However the assert statement
assert(128 == paddedPlaintext.length * 8);
checks if paddedPlaintext is exactly 128-bits long.They should be switched to
assert(0 == paddedPlaintext.length % 16);
(16 bytes = 128 bits)