1 // SPDX-License-Identifier: BSD-2-Clause
2 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3 *
4 * LibTomCrypt is a library that provides various cryptographic
5 * algorithms in a highly modular and flexible manner.
6 *
7 * The library is free for all purposes without any express
8 * guarantee it works.
9 */
10 #include "tomcrypt_private.h"
11
12 /**
13 @file ofb_decrypt.c
14 OFB implementation, decrypt data, Tom St Denis
15 */
16
17 #ifdef LTC_OFB_MODE
18
19 /**
20 OFB decrypt
21 @param ct Ciphertext
22 @param pt [out] Plaintext
23 @param len Length of ciphertext (octets)
24 @param ofb OFB state
25 @return CRYPT_OK if successful
26 */
ofb_decrypt(const unsigned char * ct,unsigned char * pt,unsigned long len,symmetric_OFB * ofb)27 int ofb_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, symmetric_OFB *ofb)
28 {
29 LTC_ARGCHK(pt != NULL);
30 LTC_ARGCHK(ct != NULL);
31 LTC_ARGCHK(ofb != NULL);
32 return ofb_encrypt(ct, pt, len, ofb);
33 }
34
35
36 #endif
37
38
39
40 /* ref: $Format:%D$ */
41 /* git commit: $Format:%H$ */
42 /* commit time: $Format:%ai$ */
43