Path: blob/master/libs/tomcrypt/src/encauth/ocb/ocb_done_encrypt.c
5972 views
/* LibTomCrypt, modular cryptographic library -- Tom St Denis1*2* LibTomCrypt is a library that provides various cryptographic3* algorithms in a highly modular and flexible manner.4*5* The library is free for all purposes without any express6* guarantee it works.7*/89/**10@file ocb_done_encrypt.c11OCB implementation, terminate encryption, by Tom St Denis12*/13#include "tomcrypt.h"1415#ifdef LTC_OCB_MODE1617/**18Terminate an encryption OCB state19@param ocb The OCB state20@param pt Remaining plaintext (if any)21@param ptlen The length of the plaintext (octets)22@param ct [out] The ciphertext (if any)23@param tag [out] The tag for the OCB stream24@param taglen [in/out] The max size and resulting size of the tag25@return CRYPT_OK if successful26*/27int ocb_done_encrypt(ocb_state *ocb, const unsigned char *pt, unsigned long ptlen,28unsigned char *ct, unsigned char *tag, unsigned long *taglen)29{30LTC_ARGCHK(ocb != NULL);31LTC_ARGCHK(pt != NULL);32LTC_ARGCHK(ct != NULL);33LTC_ARGCHK(tag != NULL);34LTC_ARGCHK(taglen != NULL);35return s_ocb_done(ocb, pt, ptlen, ct, tag, taglen, 0);36}3738#endif394041