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.

From wikipedia: "They differ in the word size; SHA-256 uses 32-bit words where SHA-512 uses 64-bit words."

In this context what do they mean with words? is it the same as a 32 bit (or 64 bit) block in a block cipher? just simply the size in which it divides up it's input?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

Word size is not a term originating in cryptography. Rather it is a term which came from the area of computer architecture. Here it specifies either how many bits are transferred over a bus at a time or the size of a register.

When used in the description of cryptographic primitives (such as a compression function or a block cipher), it covers the size of the variables in the definition of the primitive. Ideally these variable sizes line up with the register size of the CPU they are going to be executed on.

In case of the SHA-2 family, the internal state is always 8 words, and the block size is always 16 words. The word size is either 32 bits or 64 bits.

This is why on a 32 bit CPU SHA-224 and SHA-256 are faster than the other variants, but on a 64 bit CPU they are slower than the other variants.

share|improve this answer
    
Great and clear explanation, also explains why SHA-512 is faster than SHA-256 on 64 bit pc, which I found counter intuitive. –  Vincent Advocaat Apr 30 at 10:28

The word size in hash functions means the size of the integral unit of operation for the internal transformations.

For example: for SHA-512, you'll get some input, split it and then perform operations on 64-bit words (=unsigned integers, like modulo addition or shift) whereas for SHA-256 you'll use 32-bit operations (= operations on 32-bit-integers, like modulo addition or shift).

The name "word" is derived from machine word which refers to the "natural unit of data used by a particular processor design". In this case though it is the natural unit for the hash function.

share|improve this answer
    
So simply the same as block size for block ciphers. –  Vincent Advocaat Apr 30 at 7:39
1  
no, not the same as the block size –  Richie Frame Apr 30 at 7:42
1  
more like the smallest unit used while scrambling the block. –  SEJPM Apr 30 at 7:44
3  
@VincentAdvocaat The block size within the SHA-512 is larger than 64 bit. The block size is already part of the hash design; the word size is used in turn to process the blocks. –  Maarten Bodewes Apr 30 at 7:48
1  
@MaartenBodewes In fact the block size in SHA-2 is exactly 16 words, and the internal state is 8 words. That is true for all the variants. –  kasperd Apr 30 at 10:14

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.