Update deps

This commit is contained in:
Frank Denis 2020-09-21 02:15:51 +02:00
parent 8b72e58656
commit 7b7107902b
24 changed files with 21189 additions and 1929 deletions

View file

@ -1,6 +1,7 @@
package xsecretbox
import (
crypto_rand "crypto/rand"
"errors"
"github.com/aead/chacha20/chacha"
@ -16,6 +17,9 @@ func SharedKey(secretKey [32]byte, publicKey [32]byte) ([32]byte, error) {
c |= sharedKey[i]
}
if c == 0 {
if _, err := crypto_rand.Read(sharedKey[:]); err != nil {
return sharedKey, nil
}
return sharedKey, errors.New("weak public key")
}
var nonce [16]byte