1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis */
2 /* SPDX-License-Identifier: Unlicense */
3 #include "tomcrypt_private.h"
4 
5 /**
6   @file ctr_decrypt.c
7   CTR implementation, decrypt data, Tom St Denis
8 */
9 
10 #ifdef LTC_CTR_MODE
11 
12 /**
13    CTR decrypt
14    @param ct      Ciphertext
15    @param pt      [out] Plaintext
16    @param len     Length of ciphertext (octets)
17    @param ctr     CTR state
18    @return CRYPT_OK if successful
19 */
ctr_decrypt(const unsigned char * ct,unsigned char * pt,unsigned long len,symmetric_CTR * ctr)20 int ctr_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_CTR *ctr)
21 {
22    LTC_ARGCHK(pt != NULL);
23    LTC_ARGCHK(ct != NULL);
24    LTC_ARGCHK(ctr != NULL);
25 
26    return ctr_encrypt(ct, pt, len, ctr);
27 }
28 
29 #endif
30 
31