Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/libs/tomcrypt/src/modes/ctr/ctr_done.c
5972 views
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 ctr_done.c
13
CTR implementation, finish chain, Tom St Denis
14
*/
15
16
#ifdef LTC_CTR_MODE
17
18
/** Terminate the chain
19
@param ctr The CTR chain to terminate
20
@return CRYPT_OK on success
21
*/
22
int ctr_done(symmetric_CTR *ctr)
23
{
24
int err;
25
LTC_ARGCHK(ctr != NULL);
26
27
if ((err = cipher_is_valid(ctr->cipher)) != CRYPT_OK) {
28
return err;
29
}
30
cipher_descriptor[ctr->cipher].done(&ctr->key);
31
return CRYPT_OK;
32
}
33
34
35
36
#endif
37
38