diff options
author | sina <sina@snix.ir> | 2022-07-30 19:18:38 +0430 |
---|---|---|
committer | sina <sina@snix.ir> | 2022-07-30 19:18:38 +0430 |
commit | 9a0a5983d345178822158a7fa356841e26e8d9b5 (patch) | |
tree | 24a0aa73063b63b060f7960412fc47db4a21349d | |
parent | 106aa62c63960c7931e4f811923250e9f4e48f8b (diff) |
subtle package
-rw-r--r-- | cipher.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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") } |