]> pd.if.org Git - zpackage/blob - libtomcrypt/src/modes/lrw/lrw_done.c
0088f6287e55308f0252bd63dbbe438279354650
[zpackage] / libtomcrypt / src / modes / lrw / lrw_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 lrw_done.c
13    LRW_MODE implementation, Free resources, Tom St Denis
14 */
15
16 #ifdef LTC_LRW_MODE
17
18 /**
19   Terminate a LRW state
20   @param lrw   The state to terminate
21   @return CRYPT_OK if successful
22 */
23 int lrw_done(symmetric_LRW *lrw)
24 {
25    int err;
26
27    LTC_ARGCHK(lrw != NULL);
28
29    if ((err = cipher_is_valid(lrw->cipher)) != CRYPT_OK) {
30       return err;
31    }
32    cipher_descriptor[lrw->cipher].done(&lrw->key);
33
34    return CRYPT_OK;
35 }
36
37 #endif
38 /* ref:         $Format:%D$ */
39 /* git commit:  $Format:%H$ */
40 /* commit time: $Format:%ai$ */