aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsina <sina@snix.ir>2022-07-30 19:18:38 +0430
committersina <sina@snix.ir>2022-07-30 19:18:38 +0430
commit9a0a5983d345178822158a7fa356841e26e8d9b5 (patch)
tree24a0aa73063b63b060f7960412fc47db4a21349d
parent106aa62c63960c7931e4f811923250e9f4e48f8b (diff)
subtle package
-rw-r--r--cipher.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cipher.go b/cipher.go
index 278172d..a75e3f7 100644
--- a/cipher.go
+++ b/cipher.go
@@ -6,6 +6,7 @@ import (
"snix.ir/poly1305"
"snix.ir/rabbitio"
+ "snix.ir/rabbitio/subtle"
)
const polykeylen = 0x20 // poly1305 key len: 32byte
@@ -44,7 +45,7 @@ func (c *rabbitPoly1305) NonceSize() int { return c.noncesize }
func (c *rabbitPoly1305) sealRabbit(dst, nonce, plaintext, ad []byte) []byte {
ret, out := headtail(dst, len(plaintext)+poly1305.TagSize)
ciphertext, tag := out[:len(plaintext)], out[len(plaintext):]
- if rabbitio.InexactOverlap(out, plaintext) {
+ if subtle.InexactOverlap(out, plaintext) {
panic("rabaead: invalid buffer memory overlap")
}
@@ -91,7 +92,7 @@ func (c *rabbitPoly1305) openRabbit(dst, nonce, ciphertext, ad []byte) ([]byte,
writeUint64(p, len(ciphertext))
ret, out := headtail(dst, len(ciphertext))
- if rabbitio.InexactOverlap(out, ciphertext) {
+ if subtle.InexactOverlap(out, ciphertext) {
panic("rabaead: invalid buffer memory overlap")
}

Snix LLC Git Repository Holder Copyright(C) 2022 All Rights Reserved Email To Snix.IR