| QuickCrypt Library | API |
|
SL_CBC_Init
int SL_CRYPTCALL SL_CBC_Init( void* pContext, int nDir, const void* pIV, int bPadded );
Return Value
1 if initializations was successful; otherwise 0.
Parameters
pContext
[out] Pointer to the memory buffer that will be used as a context.
nDir
[in] Cipher direction. It can be SLC_ENCRYPT or SLC_DECRYPT.
pIV
[in] Pointer to the initialization vector.
bPadded
[in] Padding flag. If the memory block that has to be processed is shorter than BLOCKSIZE bytes and bPadded is true than the padding string is appended to the end of the block. The complementary length of the last block will be used as the padding character. If bPadded is false, no padding is done.
Remarks
Initializes the context pointed by pContext with the initialization vector pointed by pIV. The context is initialized for encryption if nDir is SLC_ENCRYPT, or it is initialized for decryption if nDir is SLC_DECRYPT.
Before calling the SL_CBC_Init function, allocate at least CONTEXTSIZE bytes for the context. For example, to perform Blowfish encryption/decryption allocate at least SLC_BLOWFISH_CONTEXTSIZE bytes for the context.
Before calling SL_CBC_Init call the Init function of the encryption algorithm you need to use. For example, to perform DES encryption/decryption in CBC mode call SL_DES_Init function before calling SL_CBC_Init.
Example
|
|
CBC Mode API Overview | CBC Mode API Functions | Useful Links
See Also SL_CBC_ProcessBlock, SL_CBC_ProcessLastBlock, SL_CBC_Process
| Send Feedback to SlavaSoft Inc. | Tell a friend about QuickCrypt Library |