Message Digests
160 RSA BSAFE Crypto-C Developers Guide
This routine can be called until all of the data blocks have been digested. We can then
restore the algorithm object and call B_DigestFinal() to obtain the message digest.
Note that following a call to B_*Final, the algorithm object is restored to the state it
was in following the previous B_*Init call.
The mdigsv.c program shows that digesting a file using all three methods produce the
same result.
T_memcpy (newStateInfo.data, bsfStateInfo.data, newStateInfo.len);
} while (0);
if (status != 0)
RSA_PrintError ("DigestDataSavedState", status);
else {
/* update stateInfo so the caller can have an updated algorithm object */
T_memset (stateInfo->data, 0, stateInfo->len);
T_free (stateInfo->data);
stateInfo->data = newStateInfo.data;
stateInfo->len = newStateInfo.len;
}
B_DestroyAlgorithmObject (&digestObj);
return status;
} /* end DigestDataSavedState */