B_DigestInit

B_DigestInit

B_DigestInit

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 */

);

 

 

 

 

 

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.

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

Value

Description

0

Operation was successful.

non-zero

see Appendix A, “Crypto-C Error Types”

 

 

3 0 6

R S A B S A F E C r y p t o - C L i b r a r y R e f e r e n c e M a n u a l

Page 316
Image 316
RSA Security 5 manual Int BDigestInit