SHA-256 Final Value Construction and Output
Final Value Construction and Output
The last step of our SHA-256 GoLang implementation is to take the final chaining variable values we computed using the compression function in the previous step, concatenate them into a single hexadecimal string, and output the result. Since our program is a CLI program, our result can simply be printed to STDOUT using a print statement:
PrintFinalHashValues takes the computed chaining variable hash values as an input array and returns them concatenated as a single hexadecimal string:
Finally, our result is printed to STDOUT:
When we run our implementation, we see our output using our test input string of "abc" matches the expected output for the string "abc" specified in the NIST.FIPS.180-4 specification:
Last updated