[Cryptography Team] isProperlyPadded

Ron Teitelbaum Ron at USMedRec.com
Fri Jul 7 03:08:16 UTC 2006


Chris,

 

I ran into your padding methods which put the remainder size in each empty
space after the real data.

 

I have a problem with 

 

ByteArray>>unpaddedSize

            "If I was padded by a BlockCipher, answer the size of the
original plaintext."

            self isProperlyPadded ifFalse: [ CryptographyError signal:
'Authentication failure (improperly padded!)' ].

            ^ self size - self last

 

Since isProperlyPadded assumes that that was some padding the error seems
unnecessary.

 

Shouldn't this say: 

 

ByteArray>>unpaddedSize

            "If I was padded by a BlockCipher, answer the size of the
original plaintext."

            self isProperlyPadded ifFalse: [^self size].

            ^ self size - self last

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/cryptography/attachments/20060706/ca71a2cc/attachment.htm


More information about the Cryptography mailing list