Browse Source

API: Return nil on Open failures.

Yawning Angel 1 year ago
parent
commit
78b167c9b4
1 changed files with 1 additions and 0 deletions
  1. 1 0
      norx.go

+ 1 - 0
norx.go

@@ -66,6 +66,7 @@ func aeadDecrypt(l int, m, a, c, z, nonce, key []byte) ([]byte, bool) {
 	ok := subtle.ConstantTimeCompare(srcTag, tag[:]) == 1
 	if !ok { // burn decrypted plaintext on auth failure
 		burnBytes(out[:cLen-bytesT])
+		ret = nil
 	}
 
 	burnUint64s(s.s[:])