bug-commoncpp
[Top][All Lists]
Advanced

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

Re: SHA1Digest and SHA256Digest


From: Federico Montesino Pouzols
Subject: Re: SHA1Digest and SHA256Digest
Date: Wed, 20 Nov 2002 11:12:22 +0100
User-agent: Mutt/1.4i

        Hi,

On Tue, Nov 19, 2002 at 03:54:49PM -0600, Elizabeth Barham wrote:
> 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.
> 

        Good. I think these classes fit perfectly with cc++.

>    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).
> 

        Personally, I think that adding the two exception cases is ok.

>    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.)
> 

        Umm, I think these two classes are suitable for both 1.0 and
1.1 series.  I would say that they could be added along with a short
demo/test app, regardless of whether exceptions are included or not.

>    Thank you,
> 
>    Elizabeth
> 
> 
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp




reply via email to

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