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_done.c 14 OFB implementation, finish chain, Tom St Denis 15 */ 16 17 #ifdef LTC_OFB_MODE 18 19 /** Terminate the chain 20 @param ofb The OFB chain to terminate 21 @return CRYPT_OK on success 22 */ ofb_done(symmetric_OFB * ofb)23int ofb_done(symmetric_OFB *ofb) 24 { 25 int err; 26 LTC_ARGCHK(ofb != NULL); 27 28 if ((err = cipher_is_valid(ofb->cipher)) != CRYPT_OK) { 29 return err; 30 } 31 cipher_descriptor[ofb->cipher]->done(&ofb->key); 32 return CRYPT_OK; 33 } 34 35 36 37 #endif 38 39 /* ref: $Format:%D$ */ 40 /* git commit: $Format:%H$ */ 41 /* commit time: $Format:%ai$ */ 42