aboutsummaryrefslogtreecommitdiff
path: root/internal/stupidgcm/stupidchacha.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-09-03 17:11:57 +0200
committerJakob Unterwurzacher2021-09-07 18:14:05 +0200
commit69d626b26f5a3f55c752b59af44710b992e2ab76 (patch)
tree030d8b65aedb4a6d8e40c3f9c3552775a38d0669 /internal/stupidgcm/stupidchacha.go
parenta3f5a8492a8bc62d8e2a639bd449b425efa66ce2 (diff)
stupidgcm: replace chacha20poly1305_seal with generic aead_seal
Diffstat (limited to 'internal/stupidgcm/stupidchacha.go')
-rw-r--r--internal/stupidgcm/stupidchacha.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/internal/stupidgcm/stupidchacha.go b/internal/stupidgcm/stupidchacha.go
index 1f16a5e..18037c6 100644
--- a/internal/stupidgcm/stupidchacha.go
+++ b/internal/stupidgcm/stupidchacha.go
@@ -13,12 +13,8 @@ import (
/*
#include <openssl/evp.h>
+#include "chacha.h"
#cgo pkg-config: libcrypto
-int chacha20poly1305_seal(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);
*/
import "C"
@@ -75,7 +71,8 @@ func (g *stupidChacha20poly1305) Seal(dst, iv, in, authData []byte) []byte {
buf = make([]byte, outLen)
}
- C.chacha20poly1305_seal((*C.uchar)(&in[0]),
+ C.aead_seal(C.aeadTypeChacha,
+ (*C.uchar)(&in[0]),
C.int(len(in)),
(*C.uchar)(&authData[0]),
C.int(len(authData)),