|
|
@@ -55,7 +55,7 @@ func NewCipher(cipherFunc func([]byte) (cipher.Block, error), key []byte) (c *Ci
|
|
|
}
|
|
|
|
|
|
// Encrypt encrypts a sector of plaintext and puts the result into ciphertext.
|
|
|
-// Plaintext and ciphertext may be the same slice but should not overlap.
|
|
|
+// Plaintext and ciphertext must overlap entirely or not at all.
|
|
|
// Sectors must be a multiple of 16 bytes and less than 2²⁴ bytes.
|
|
|
func (c *Cipher) Encrypt(ciphertext, plaintext []byte, sectorNum uint64) {
|
|
|
if len(ciphertext) < len(plaintext) {
|
|
|
@@ -86,7 +86,7 @@ func (c *Cipher) Encrypt(ciphertext, plaintext []byte, sectorNum uint64) {
|
|
|
}
|
|
|
|
|
|
// Decrypt decrypts a sector of ciphertext and puts the result into plaintext.
|
|
|
-// Plaintext and ciphertext may be the same slice but should not overlap.
|
|
|
+// Plaintext and ciphertext must overlap entirely or not at all.
|
|
|
// Sectors must be a multiple of 16 bytes and less than 2²⁴ bytes.
|
|
|
func (c *Cipher) Decrypt(plaintext, ciphertext []byte, sectorNum uint64) {
|
|
|
if len(plaintext) < len(ciphertext) {
|