On 11/24/06, cerebus2@gmail.com cerebus2@gmail.com wrote:
Added AES192 and overloaded the blockSize: and keySize: methods with do-nothings (is there a better way to do this?) since they make no sense for AES. Part of me is thinking that these should be a single class with keySize selection at instance creation. Comments welcome."!
I'm also working on a couple of tests, but I'll note that I threw a couple of FIPS 197 and RFC3602 test vectors at these classes and they came out fine.
The more I think about it the more I think I'll refactor as a single class.
-- Tim
It seems like a good idea to refactor as a single class. However, even with a single class that can handle multiple key sizes, it seems redundant to have a #keySize: method, when the size of the key can be easily determined in #key: . It would make sense to make this change in Rijndael, and have AES inherit it.
With respect to #blockSize:, it might be better to throw an exception (eg: 'AES does not support multiple block sizes; use Rijndael instead') so that the user is educated, rather than assuming that the method does something when it really doesn't.
Cheers, Josh
On Nov 24, 2006, at 9:17 PM, Cerebus wrote:
On 11/24/06, cerebus2@gmail.com cerebus2@gmail.com wrote:
Added AES192 and overloaded the blockSize: and keySize: methods with do-nothings (is there a better way to do this?) since they make no sense for AES. Part of me is thinking that these should be a single class with keySize selection at instance creation. Comments welcome."!
I'm also working on a couple of tests, but I'll note that I threw a couple of FIPS 197 and RFC3602 test vectors at these classes and they came out fine.
The more I think about it the more I think I'll refactor as a single class.
-- Tim _______________________________________________ Cryptography mailing list Cryptography@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/ cryptography
On 11/24/06, Joshua Gargus schwa@fastmail.us wrote:
It seems like a good idea to refactor as a single class. However, even with a single class that can handle multiple key sizes, it seems redundant to have a #keySize: method, when the size of the key can be easily determined in #key: . It would make sense to make this change in Rijndael, and have AES inherit it.
I *just* posted a refactoring.
With respect to #blockSize:, it might be better to throw an exception (eg: 'AES does not support multiple block sizes; use Rijndael instead') so that the user is educated, rather than assuming that the method does something when it really doesn't.
Good point. I guess I'll have to go learn exceptions now. Tomorrow. Err, today. In the morning--wait. After some sleep. :)
-- Tim
On Nov 24, 2006, at 10:25 PM, Cerebus wrote:
On 11/24/06, Joshua Gargus schwa@fastmail.us wrote:
It seems like a good idea to refactor as a single class. However, even with a single class that can handle multiple key sizes, it seems redundant to have a #keySize: method, when the size of the key can be easily determined in #key: . It would make sense to make this change in Rijndael, and have AES inherit it.
I *just* posted a refactoring.
With respect to #blockSize:, it might be better to throw an exception (eg: 'AES does not support multiple block sizes; use Rijndael instead') so that the user is educated, rather than assuming that the method does something when it really doesn't.
Good point. I guess I'll have to go learn exceptions now.
Easy. Just make a new subclass of Error, perhaps ImproperCipherUse, and then override #blockSize: to signal it:
blockSize: aNumber ImproperCipherUse signal: 'AES does not support multiple block sizes; use Rijndael instead'
Josh
Tomorrow. Err, today. In the morning--wait. After some sleep. :)
:-)
Josh
-- Tim _______________________________________________ Cryptography mailing list Cryptography@lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/ cryptography
cryptography@lists.squeakfoundation.org