I have been trying to create my own sha256 hash generator in Python. I have been following this tutorial https://qvault.io/cryptography/how-sha-2-works-step-by-step-sha-256/ but I got stuck at step 5. They say that when adding binary numbers "addition is calculated modulo 2^32" but I couldn't understand how to do that. If I add the binary numbers normally the result is 1 digit longer/shorter.
Asked
Active
Viewed 35 times
0
-
1So then could take the result and perform mod 2-to-32 on it. (Or mask it with 0xffffffff, which is 2-to-32 minus 1.) – khelwood Aug 06 '21 at 20:11