status-go/vendor/github.com/mutecomm/go-sqlcipher/v4/cbc_done.c

31 lines
577 B
C
Raw Normal View History

/* LibTomCrypt, modular cryptographic library -- Tom St Denis */
/* SPDX-License-Identifier: Unlicense */
#include "tomcrypt_private.h"
/**
@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;
}
#endif