diff options
| author | Jakob Unterwurzacher | 2021-09-04 11:41:56 +0200 | 
|---|---|---|
| committer | Jakob Unterwurzacher | 2021-09-07 18:14:05 +0200 | 
| commit | e2ec048a09889b2bf71e8bbfef9f0584ff7d69db (patch) | |
| tree | 84bb1f8c709f8db3b2dd551c7c5343c0ffe44ed9 /internal/stupidgcm/chacha.h | |
| parent | bf572aef88963732849b8e5ae679e63c6be4aa46 (diff) | |
stupidgcm: introduce stupidAEADCommon and use for both chacha & gcm
Nice deduplication and brings the GCM decrypt speed up to par.
internal/speed$ benchstat old new
name                old time/op   new time/op   delta
StupidGCM-4          4.71µs ± 0%   4.66µs ± 0%   -0.99%  (p=0.008 n=5+5)
StupidGCMDecrypt-4   5.77µs ± 1%   4.51µs ± 0%  -21.80%  (p=0.008 n=5+5)
name                old speed     new speed     delta
StupidGCM-4         870MB/s ± 0%  879MB/s ± 0%   +1.01%  (p=0.008 n=5+5)
StupidGCMDecrypt-4  710MB/s ± 1%  908MB/s ± 0%  +27.87%  (p=0.008 n=5+5)
Diffstat (limited to 'internal/stupidgcm/chacha.h')
| -rw-r--r-- | internal/stupidgcm/chacha.h | 32 | 
1 files changed, 0 insertions, 32 deletions
diff --git a/internal/stupidgcm/chacha.h b/internal/stupidgcm/chacha.h deleted file mode 100644 index a5eac04..0000000 --- a/internal/stupidgcm/chacha.h +++ /dev/null @@ -1,32 +0,0 @@ -enum aeadType { -    aeadTypeChacha = 1, -    aeadTypeGcm = 2, -}; - -int aead_seal( -    const enum aeadType cipherId, -    const unsigned char* const plaintext, -    const int plaintextLen, -    const unsigned char* const authData, -    const int authDataLen, -    const unsigned char* const key, -    const int keyLen, -    const unsigned char* const iv, -    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);  | 
