1 // SPDX-License-Identifier: BSD-2-Clause 2 /* LibTomCrypt, modular cryptographic library -- Tom St Denis 3 * 4 * LibTomCrypt is a library that provides various cryptographic 5 * algorithms in a highly modular and flexible manner. 6 * 7 * The library is free for all purposes without any express 8 * guarantee it works. 9 */ 10 #include "tomcrypt_private.h" 11 12 /** 13 @file cbc_done.c 14 CBC implementation, finish chain, Tom St Denis 15 */ 16 17 #ifdef LTC_CBC_MODE 18 19 /** Terminate the chain 20 @param cbc The CBC chain to terminate 21 @return CRYPT_OK on success 22 */ cbc_done(symmetric_CBC * cbc)23int cbc_done(symmetric_CBC *cbc) 24 { 25 int err; 26 LTC_ARGCHK(cbc != NULL); 27 28 if ((err = cipher_is_valid(cbc->cipher)) != CRYPT_OK) { 29 return err; 30 } 31 cipher_descriptor[cbc->cipher]->done(&cbc->key); 32 return CRYPT_OK; 33 } 34 35 36 37 #endif 38 39 /* ref: $Format:%D$ */ 40 /* git commit: $Format:%H$ */ 41 /* commit time: $Format:%ai$ */ 42