B_SetAlgorithmInfo

B_SetAlgorithmInfo

int B_SetAlgorithmInfo (

 

B_ALGORITHM_OBJ algorithmObject,

/* algorithm object */

B_INFO_TYPE

infoType,

/* type of algorithm information */

POINTER

info

/* algorithm information */

);

 

 

 

 

 

Description

B_SetAlgorithmInfo sets the parameters of algorithmObject to the information pointed to by info. The type of algorithm and the format of the parameters is specified by infoType, which is one of the algorithm info types with an AI_ prefix listed in Chapter 2. A separate copy of the information supplied by info is allocated inside the algorithm object so that info may be changed after the call to B_SetAlgorithmInfo. B_SetAlgorithmInfo returns BE_WRONG_ALGORITHM_INFO if the algorithm type encoded in info is not the type expected by infoType.

Once an algorithm object has been set, it should not be reset; that is, do not call

B_SetAlgorithmInfo twice on a single created algorithm object. Either create a new algorithm object, or destroy an existing one and create it again.

Return value

Value

Description

0

Operation was successful.

non-zero

see Appendix A, ”Crypto-C Error Types”

 

 

3 3 0

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 340
Image 340
RSA Security 5 manual Int BSetAlgorithmInfo