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