From f097f910851aeb82d4ce71fc7daf3c4b7a8757c1 Mon Sep 17 00:00:00 2001 From: Silke Date: Mon, 13 Mar 2017 15:05:44 +0100 Subject: [PATCH] Fix two open functions in crypto_box_easy Both CryptoBoxOpenEasy and CryptoBoxOpenDetached called wrong function. Closes #15 --- cryptobox/crypto_box_easy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cryptobox/crypto_box_easy.go b/cryptobox/crypto_box_easy.go index 8ed80c6..2192fe1 100644 --- a/cryptobox/crypto_box_easy.go +++ b/cryptobox/crypto_box_easy.go @@ -92,7 +92,7 @@ func CryptoBoxOpenDetached(c []byte, mac []byte, n []byte, pk []byte, sk []byte) support.CheckSize(pk, CryptoBoxPublicKeyBytes(), "public key") support.CheckSize(sk, CryptoBoxSecretKeyBytes(), "secret key") m := make([]byte, len(c)-CryptoBoxMacBytes()) - exit := int(C.crypto_box_detached( + exit := int(C.crypto_box_open_detached( (*C.uchar)(&m[0]), (*C.uchar)(&c[0]), (*C.uchar)(&mac[0]), @@ -123,7 +123,7 @@ func CryptoBoxOpenEasy(c []byte, n []byte, pk []byte, sk []byte) ([]byte, int) { support.CheckSize(pk, CryptoBoxPublicKeyBytes(), "public key") support.CheckSize(sk, CryptoBoxSecretKeyBytes(), "secret key") m := make([]byte, len(c)-CryptoBoxMacBytes()) - exit := int(C.crypto_box_easy( + exit := int(C.crypto_box_open_easy( (*C.uchar)(&m[0]), (*C.uchar)(&c[0]), (C.ulonglong)(len(c)),