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