aboutsummaryrefslogtreecommitdiff
path: root/internal/stupidgcm/chacha.h
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-09-03 18:44:41 +0200
committerJakob Unterwurzacher2021-09-07 18:14:05 +0200
commitbf572aef88963732849b8e5ae679e63c6be4aa46 (patch)
treed19debcb4c435dfda435c0497c33247bfc7006b0 /internal/stupidgcm/chacha.h
parent3e27acb989614f82a25d50ab19a0a4419f19aa27 (diff)
stupidgcm: stupidChacha20poly1305.Open: batch C calls in aead_open
Gets the decryption speed to the same level as the encryption speed. internal/speed$ benchstat old.txt new.txt name old time/op new time/op delta StupidXchacha-4 732MB/s ± 0% 740MB/s ± 0% ~ (p=1.000 n=1+1) StupidXchachaDecrypt-4 602MB/s ± 0% 741MB/s ± 0% ~ (p=1.000 n=1+1)
Diffstat (limited to 'internal/stupidgcm/chacha.h')
-rw-r--r--internal/stupidgcm/chacha.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/stupidgcm/chacha.h b/internal/stupidgcm/chacha.h
index 780350a..a5eac04 100644
--- a/internal/stupidgcm/chacha.h
+++ b/internal/stupidgcm/chacha.h
@@ -15,3 +15,18 @@ int aead_seal(
const int ivLen,
unsigned char* const ciphertext,
const int ciphertextBufLen);
+
+int aead_open(
+ const enum aeadType cipherId,
+ const unsigned char* const ciphertext,
+ const int ciphertextLen,
+ const unsigned char* const authData,
+ const int authDataLen,
+ unsigned char* const tag,
+ const int tagLen,
+ const unsigned char* const key,
+ const int keyLen,
+ const unsigned char* const iv,
+ const int ivLen,
+ unsigned char* const plaintext,
+ const int plaintextBufLen);