CBC Mode API assists you in performing
encryption/decryption in
CBC mode
of operation.
To encrypt/decrypt a continuous memory buffer,
perform the following:
Allocate at least
CONTEXTSIZE bytes
for the
context.
For example, to perform DES encryption/decryption allocate at least
SLC_DES_CONTEXTSIZE bytes for the context.
Call the Init functionof the
encryption algorithm you need to use, passing to it the secret key and the
cipher direction (SLC_ENCRYPT or SLC_DECRYPT). For example, to perform DES encryption/decryption call
SL_DES_Init function.
Call the
SL_CBC_Init functiontoinitialize the
context
with the initialization vector and with the cipher direction (SLC_ENCRYPT or SLC_DECRYPT).
The cipher direction must be the same as in previous step.
Call the SL_CBC_Process function
to encrypt/decrypt the memory buffer.