B_DigestInit
306 RSA BSAFE Crypto-C Library Reference Manual
B_DigestInit
Description
B_DigestInit initializes
algorithmObject
for computing a message digest using the
algorithm specified by a previous call to B_SetAlgorithmInfo. The chooser for
selecting the algorithm method is
algorithmChooser
. The key object for supplying the
key information is
keyObject
; it should be (B_KEY_OBJ)NULL_PTR for keyless digesting
algorithms. The surrender context for processing and canceling during lengthy
operations is
surrenderContext
; if its value is (A_SURRENDER_CTX *)NULL_PTR, Crypto-C
does not use it.
B_DigestInit only needs to be called once to set up a digest algorithm. The
B_DigestUpdate routine can be called multiple times to process blocks of data, and
B_DigestFinal is called once to process the last block which includes producing the
result. After B_DigestFinal is called, B_DigestUpdate can be called to start digesting
another sequence of blocks. There is no need to call B_DigestInit again.
Return value
int B_DigestInit (
B_ALGORITHM_OBJ algorithmObject, /* algorithm object */
B_KEY_OBJ keyObject, /* key object */
B_ALGORITHM_CHOOSER algorithmChooser, /* algorithm chooser */
A_SURRENDER_CTX *surrenderContext /* surrender context */
);
Value Description
0 Operation was successful.
non-zero see Appendix A, “Crypto-C Error Types”