On Fri, 2003-11-07 at 00:11, Wei Dai wrote: > Exceptions are used frequently in Crypto++. They are used to indicate well > defined error conditions, whereas asserts are used to find programming > mistakes. If you hit an exception, you can catch it and continue. If you > hit an assert, it means there's a bug in your code or in Crypto++ that > needs to be fixed (or possibly there's a hardware error that caused an > incorrect calculation).
I believe that asserts should be eliminated. They only cause the program to 'Abort' and not give you any reason for why. I found that a simple program was failing because I failed to give the full block size for a block cipher (3DES). It failed with an abort. I would have been nice to receive an exception like InvalidBlockSize. This way I would be forced by the design of Crypto++ to be aware of this. I believe this would be very helpful for new programmers and for reminding ourselves. I was thinking about how Crypto++ could be used in more embedded devices. These devices might have an ability to be updated with a new required information and data but lack any output terminal to alert the user that the device failed. As a professor I know at Vanderbilt says where is stdout on a missle? Stephen -- Stephen Torri GPG Key: http://www.cs.wustl.edu/~storri/storri.asc
signature.asc
Description: This is a digitally signed message part
