# How to compute initial buffer of SHA-512?

I'm reading Cryptography And Network Security of William Stallings.

In the SHA-512 section it is said that there is a 512-bit buffer is used to hold the intermediate and final result and every 64-bit obtained somehow (obtained by taking the first sixty-four bits of the fractional parts of the square roots of the first eight prime numbers).

However, if I convert the first of the binary digits to base 10 I get:

a = 7640891576956012808


I searched the square root of 2 in high precision( https://apod.nasa.gov/htmltest/gifcity/sqrt2.1mil ) and did not match. Why?

• Which edition are we talking about and the page is? Here the SHA2, NIST under maintenance. – kelalaka Oct 26 '19 at 16:20
• seventh edition.end of page 357 and beginning of 358 – naweed Oct 27 '19 at 6:50

To be precise, if you shift 64 bits to the left then you multiply with $$2^{64} = 18,446,744,073,709,551,616$$ Of course, this number is far from a power of 10, so you would expect it to skew if you look at the result in decimals.
• I.e. the a you've calculated has the right value (congrats), just convert to hexadecimals or bytes. – Maarten Bodewes Oct 27 '19 at 0:56