[Cryptography Team] FW: isProperlyPadded

Ron Teitelbaum Ron at USMedRec.com
Fri Jul 7 03:10:53 UTC 2006


Hit send by accident before I finishing editing!

 

To make it more clear if a byte array is not padded then the unpaddedSize is
self size.

 

What do you think?

 

Ron Teitelbaum

 

  _____  

From: Ron Teitelbaum [mailto:Ron at USMedRec.com] 
Sent: Thursday, July 06, 2006 11:08 PM
To: 'Cryptography Team Development List'
Subject: isProperlyPadded

 

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/811e3e47/attachment.htm


More information about the Cryptography mailing list