You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "William A. Rowe, Jr." <wr...@rowe-clan.net> on 2005/08/04 08:34:04 UTC

SHA1 update v.s. update_binary

I can't quite figure the difference between apr_sha1_update and
...update_binary.  My first guess was that _update took a null term
string, while update_binary would be a counted byte array.  But both
functions take an inputLen.

Anyone have a clue to share?

Bill

Re: SHA1 update v.s. update_binary

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 08:41 AM 8/4/2005, William A. Rowe, Jr. wrote:

>It strikes me that the sha1 and md5 implementations are inconsistent,
>it seems that in apr 2.0 we should probably provide the same xlate
>handle to a given sha1_ctx_t as we have done for md5_ctx_t.  I'm not
>sure we can make such a transition before an apr 2.

And in fact, apr_sha1_ctx_t is quite transparent, so any change to
introduce the same apr_xlate_t object into that structure -must-
wait for 2.0 :-/

Bill




Re: SHA1 update v.s. update_binary

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 02:10 AM 8/4/2005, Joe Orton wrote:
>On Thu, Aug 04, 2005 at 01:34:04AM -0500, William Rowe wrote:
>> I can't quite figure the difference between apr_sha1_update and
>> ...update_binary.  My first guess was that _update took a null term
>> string, while update_binary would be a counted byte array.  But both
>> functions take an inputLen.
>
>If you look at the implementations, the key difference seems to be that 
>the _update interface performs EBCDIC->ASCII translation on the input.

It strikes me that the sha1 and md5 implementations are inconsistent,
it seems that in apr 2.0 we should probably provide the same xlate
handle to a given sha1_ctx_t as we have done for md5_ctx_t.  I'm not
sure we can make such a transition before an apr 2.

I see that the update/update_binary semantics I expected only apply
to the ap_ functions, which can probably, mostly, 'go away'.

Bill



Re: SHA1 update v.s. update_binary

Posted by Joe Orton <jo...@redhat.com>.
On Thu, Aug 04, 2005 at 01:34:04AM -0500, William Rowe wrote:
> I can't quite figure the difference between apr_sha1_update and
> ...update_binary.  My first guess was that _update took a null term
> string, while update_binary would be a counted byte array.  But both
> functions take an inputLen.

If you look at the implementations, the key difference seems to be that 
the _update interface performs EBCDIC->ASCII translation on the input.

joe