|
| B_EncryptInit |
|
|
|
B_EncryptInit |
|
|
|
|
|
int B_EncryptInit ( |
|
|
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_EncryptInit initializes algorithmObject for encrypting data using the algorithm specified by a previous call to B_SetAlgorithmInfo. The key object for supplying the key information is keyObject. The chooser for selecting the algorithm method is algorithmChooser. The surrender context for processing and canceling during lengthy operations is surrenderContext; if its value is (A_SURRENDER_CTX *)NULL_PTR,
B_EncryptInit only needs to be called once to set up a key. The B_EncryptUpdate routine can be called multiple times to process blocks of data, and B_EncryptFinal is called once to process the last block, which includes adding the trailing pad bytes. After B_EncryptFinal is called, B_EncryptUpdate can be called to start processing another sequence of blocks. If a different CBC Initialization Vector (IVs) is used with each sequence of blocks, B_SetAlgorithmInfo can be called with AI_CBC_IV8 to set the new IV before calling B_EncryptUpdate. There is no need to call B_EncryptInit again with the same key.
Return value
Value | Description |
0 | Operation was successful. |
see Appendix A, | |
|
|
C h a p t e r 4 D e t a i l s o f C r y p t o - C F u n c t i o n s | 313 |