I was not aware of the MessageDigest
class before. I am now trying to understand a segment of code and the documentation is not helping me much.
MessageDigest digest = Crypto.sha256();
digest.update(last.getSign());
byte[] SignHash = digest.digest(publicKey);
According to the java documentation:
"update" Updates this
MessageDigest
using the givenbyte[]
"digest" Performs the final update and then computes and returns the final hash value for this MessageDigest.
Question 1: What does "updates using the given byte[]" really mean?
Question 2: What is the final update performed by "digest" ?
Does the above mean SignHash=sha256(last.getSign()
concat (some padding of public key)) ?