Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
1  
It would be difficult to do otherwise, conceptually.. –  Thomas Jun 1 at 12:39
    
That makes sense, thank you. –  Steven Jun 3 at 10:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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