0
$\begingroup$

Example: http://jsfiddle.net/KGtUE/

https://code.google.com/p/crypto-js/#Progressive_Hashing

sha256.update("abc");
sha256.update("def");
sha256.update("ghi");

vs

CryptoJS.SHA256("abcdefghi");

How does this work?

$\endgroup$

1 Answer 1

2
$\begingroup$

I will assume the way my class does it is the same way other classes such as CryptoJS do it.

Quite simply, there is a buffer in the class that absorbs the input until it reaches the hash block length or a multiple thereof, then processes that section of the buffer through the compression function. Whatever is left becomes the start point of the buffer.

How to implement that buffer is up to the programmer.

$\endgroup$
1
  • 1
    $\begingroup$ It would be difficult to do otherwise, conceptually.. $\endgroup$
    – Thomas
    Commented Jun 1, 2014 at 12:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.