bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SHA1Digest and SHA256Digest


From: Elizabeth Barham
Subject: SHA1Digest and SHA256Digest
Date: 19 Nov 2002 15:54:49 -0600

Dear Everyone on this list,

   I wrote SHA1Digest and SHA256Digest classes that interface with the
Digest class and I would like to contribute it to the library.

   If this is okay with you all, I would then like to post them onto
this mailing list, although I do have one question.

   Do you believe it is proper for the digest classes to throw
exceptions in CommonC++? There are only two instances that I would
like to add exceptions, but they are important:

   1) After calculating a Digest, the "calculating sum" is corrupted
      in that one should *not* continue to feed the object data. If
      after the sum has been made and the client tries to give the
      object data, I would like to throw a "Digest All Ready
      Calculated" exception.

      Note that this should not hinder one from copying the object and
      extracting the sum from the *copy* and then continue to use the
      original.

   2) There is a size limit as to how much data a digest may represent
      (for SHA1 and SHA256, this is 2^64). Going over this limit
      should cause a "Digest Overflow" exception.

   I currently have not implemented the exceptions except that they
are in pseudo-code just waiting to be written. Nor have I written the
copy construtors although the compiler generated ones may work fine
(this needs to be verified).

   So, provided this is something the administrators are interested in
allowing into the MAIN branch, should the exceptions be raised? (The
size currently just loops over and there is no check on a corrupted
sum.)

   Thank you,

   Elizabeth




reply via email to

[Prev in Thread] Current Thread [Next in Thread]