INNER CODE UNIT · Go
UnconvertKey
cryptag/cryptag · encrypt_decrypt.go:70
func UnconvertKey(goodKey *[32]byte) ([]byte, error) {
if goodKey == nil {
return nil, ErrNilKey
}
return (*goodKey)[:], nil
}
func ConvertNonce(nonce []byte) (goodNonce *[24]byte, err error) {
if len(nonce) != validNonceLength {
return nil, ErrInvalidNonce
}
var b [24]byte
copy(b[:], nonce[:])
return &b, nil
}
func RandomNonce() (*[24]byte, error) {
var b [24]byte