AEAD/Chacha20/Poly1305 encrypt multiple buffers

This commit is contained in:
orignal 2018-11-30 14:41:14 -05:00
parent 0c9ebc36d4
commit e68f1dbc99
5 changed files with 130 additions and 69 deletions

View file

@ -3,6 +3,7 @@
#include <inttypes.h>
#include <string>
#include <vector>
#include <openssl/bn.h>
#include <openssl/dh.h>
#include <openssl/aes.h>
@ -282,6 +283,8 @@ namespace crypto
// AEAD/ChaCha20/Poly1305
bool AEADChaCha20Poly1305 (const uint8_t * msg, size_t msgLen, const uint8_t * ad, size_t adLen, const uint8_t * key, const uint8_t * nonce, uint8_t * buf, size_t len, bool encrypt); // msgLen is len without tag
void AEADChaCha20Poly1305Encrypt (std::vector<std::pair<void*, std::size_t> >& bufs, const uint8_t * key, const uint8_t * nonce, uint8_t * mac); // encrypt multiple buffers with zero ad
// init and terminate
void InitCrypto (bool precomputation);
void TerminateCrypto ();