2020-07-23 02:04:21 +00:00
|
|
|
/* LibTomCrypt, modular cryptographic library -- Tom St Denis */
|
|
|
|
/* SPDX-License-Identifier: Unlicense */
|
|
|
|
#include "tomcrypt_private.h"
|
2015-04-28 23:56:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
@file cbc_done.c
|
|
|
|
CBC implementation, finish chain, Tom St Denis
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef LTC_CBC_MODE
|
|
|
|
|
|
|
|
/** Terminate the chain
|
|
|
|
@param cbc The CBC chain to terminate
|
|
|
|
@return CRYPT_OK on success
|
|
|
|
*/
|
|
|
|
int cbc_done(symmetric_CBC *cbc)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
LTC_ARGCHK(cbc != NULL);
|
|
|
|
|
|
|
|
if ((err = cipher_is_valid(cbc->cipher)) != CRYPT_OK) {
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
cipher_descriptor[cbc->cipher].done(&cbc->key);
|
|
|
|
return CRYPT_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-23 02:04:21 +00:00
|
|
|
#endif
|