aboutsummaryrefslogtreecommitdiff
path: root/cipher.go
diff options
context:
space:
mode:
Diffstat (limited to 'cipher.go')
-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