Discussion:
[TrouSerS-users] Hash update explanation
Massimo Gaggiano
2015-06-06 23:02:42 UTC
Permalink
Hi all,
I create an "HASH_SHA1" object and update its value two times,
consecutively.
Finally I get the hash value, only after the second update. Though I
don't know what does this digest come from.

Can you give me any explanation?

I did expect that the final hash value was the second input value's
digest but, evidently, I'm wrong.

Thank you very much.

Max

------------------------------------------------------------------------------
Ken Goldman
2015-06-08 13:11:08 UTC
Permalink
The general crypto digest design pattern of "start-update-complete" is
that the result is a digest of the concatenation of all the "update"
messages, not a digest of the last message.
Post by Massimo Gaggiano
I create an "HASH_SHA1" object and update its value two times,
consecutively. Finally I get the hash value, only after the second
update. Though I don't know what does this digest come from.
Can you give me any explanation?
I did expect that the final hash value was the second input value's
digest but, evidently, I'm wrong.
------------------------------------------------------------------------------
Loading...