I’m trying to calculate the constants used for the SHA512 hash. But each iteration removes four hex digits and I’m not sure why. Any help or advice is appreciated! Let me know if something isn’t clear, and I’ll do my best to explain it better.
The first one is 428a2f98d728ae22
. It can be found by taking the cube root of 2
. Getting the mantissa/significand (ref:wikipedia). Then multiplying that by 16
. This would give you 4
, the first digit of the hex digit at the beginning of this paragraph. You then do this repeatedly until you’ve processed the first 64 bits.
These words represent the first sixty-four bits of the fractional parts of the cube roots of the first eighty prime numbers. In hex, these constant words are (from left to right)
Ref: FIPS 180-2.