diff --git a/build.bat b/build.bat index e98b5f4..914a057 100644 --- a/build.bat +++ b/build.bat @@ -1 +1,3 @@ -go build ./... \ No newline at end of file +setlocal +set CC=clang +go build ./... diff --git a/build.sh b/build.sh index 991774c..77dbe0d 100755 --- a/build.sh +++ b/build.sh @@ -1,2 +1,3 @@ #!/bin/sh -exec go build ./... \ No newline at end of file +export CC=clang +exec go build ./... diff --git a/cryptoaead/crypto_aead_aes256gcm.go b/cryptoaead/crypto_aead_aes256gcm.go index db2f1fe..e8de873 100644 --- a/cryptoaead/crypto_aead_aes256gcm.go +++ b/cryptoaead/crypto_aead_aes256gcm.go @@ -149,7 +149,7 @@ func CryptoAEADAES256GCMEncryptAfterNM(m, ad, npub, ctx []byte) ([]byte, int) { (C.ulonglong)(len(ad)), (*C.uchar)(nil), (*C.uchar)(&npub[0]), - (*[512]C.uchar)(unsafe.Pointer(&ctx[0])))) + (*C.crypto_aead_aes256gcm_state)(unsafe.Pointer(&ctx[0])))) return c, exit } @@ -171,7 +171,7 @@ func CryptoAEADAES256GCMDecryptAfterNM(c, ad, npub, ctx []byte) ([]byte, int) { (*C.uchar)(support.BytePointer(ad)), (C.ulonglong)(len(ad)), (*C.uchar)(&npub[0]), - (*[512]C.uchar)(unsafe.Pointer(&ctx[0])))) + (*C.crypto_aead_aes256gcm_state)(unsafe.Pointer(&ctx[0])))) return m, exit } @@ -194,7 +194,7 @@ func CryptoAEADAES256GCMEncryptDetachedAfterNM(m, ad, npub, ctx []byte) ([]byte, (C.ulonglong)(len(ad)), (*C.uchar)(nil), (*C.uchar)(&npub[0]), - (*[512]C.uchar)(unsafe.Pointer(&ctx[0])))) + (*C.crypto_aead_aes256gcm_state)(unsafe.Pointer(&ctx[0])))) return c, mac, exit } @@ -215,7 +215,7 @@ func CryptoAEADAES256GCMDecryptDetachedAfterNM(c, mac, ad, npub, ctx []byte) ([] (*C.uchar)(support.BytePointer(ad)), (C.ulonglong)(len(ad)), (*C.uchar)(&npub[0]), - (*[512]C.uchar)(unsafe.Pointer(&ctx[0])))) + (*C.crypto_aead_aes256gcm_state)(unsafe.Pointer(&ctx[0])))) return m, exit }