From 9a0a5983d345178822158a7fa356841e26e8d9b5 Mon Sep 17 00:00:00 2001 From: sina Date: Sat, 30 Jul 2022 19:18:38 +0430 Subject: subtle package --- cipher.go | 5 +++-- 1 file 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") } -- cgit v1.2.3