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_decrypt.c
13 CTR implementation, decrypt data, Tom St Denis
14 */
15
16 #ifdef LTC_CTR_MODE
17
18 /**
19 CTR decrypt
20 @param ct Ciphertext
21 @param pt [out] Plaintext
22 @param len Length of ciphertext (octets)
23 @param ctr CTR state
24 @return CRYPT_OK if successful
25 */
ctr_decrypt(const unsigned char * ct,unsigned char * pt,unsigned long len,symmetric_CTR * ctr)26 int ctr_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CTR *ctr)
27 {
28 LTC_ARGCHK(pt != NULL);
29 LTC_ARGCHK(ct != NULL);
30 LTC_ARGCHK(ctr != NULL);
31
32 return ctr_encrypt(ct, pt, len, ctr);
33 }
34
35 #endif
36
37
38 /* ref: $Format:%D$ */
39 /* git commit: $Format:%H$ */
40 /* commit time: $Format:%ai$ */
41