Hash Function Basics:
Definition: A cryptographic hash function transforms an input into a fixed-size string called the hash value.
Representation: It is denoted as h = H(M), where M is the message, and H(M) is the hash value.
Usage: Hash values are added to messages during transmission, and receivers authenticate by recomputing the hash.
Properties of Ideal Hash Function:
- Easy to calculate hash for any data.
- Difficult to calculate a text with a given hash.
- Highly unlikely for two different messages to have the same hash.
Working of SHA-512:
Input Length: Takes messages less than 2^128 bits, produces a 512-bit message digest.
Steps in Processing:
- Step 1: Padding: Add padding to the message, making it 64-bits short of a multiple of 512.
- Step 2: Append Length: Append the length of the message (excluding padding) as a 64-bit block.
- Step 3: Divide into Blocks: Split the message into 512-bit blocks.
- Step 4: Initialize Variables: Five chaining variables (A-E) are initialized for a 160-bit message digest.
- Step 5: Process Blocks: The main algorithm processes each block.
Round Function:
- Definition: Computes a new value for variable A, shifting all working variables once per round.
- Calculation: Involves a five-operand addition modulo 2^32, with operands based on input words, round-dependent constant (Kt), and current message word (Wt).
SHA-512 Block Diagram:
- Components:
- SHA1 Engine: Applies SHA1 loops on a 512-bit message block.
- Padding Unit: Splits input into 512-bit blocks and pads the last block.
- Processing Time: Each 512-bit block processed in 82 clock cycles, achieving a bit-rate of 6.24 Mbps/MHz.