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 cfb_done.c
14    CFB implementation, finish chain, Tom St Denis
15 */
16 
17 #ifdef LTC_CFB_MODE
18 
19 /** Terminate the chain
20   @param cfb    The CFB chain to terminate
21   @return CRYPT_OK on success
22 */
cfb_done(symmetric_CFB * cfb)23 int cfb_done(symmetric_CFB *cfb)
24 {
25    int err;
26    LTC_ARGCHK(cfb != NULL);
27 
28    if ((err = cipher_is_valid(cfb->cipher)) != CRYPT_OK) {
29       return err;
30    }
31    cipher_descriptor[cfb->cipher]->done(&cfb->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