Skip to content

Commit a953f5e

Browse files
committed
Fix code comments
1 parent 2ab1899 commit a953f5e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

draft-denis-ipcrypt.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ Test vectors are provided in {{ipcrypt-nd-test-vectors}}.
547547

548548
The `ipcrypt-ndx` instantiation uses the AES-XTS tweakable block cipher with a 16-byte (128-bit) tweak. The output is 32 bytes total, consisting of a 16-byte tweak concatenated with a 16-byte ciphertext.
549549

550-
Since only a single block is encrypted, the construction is equivalent to AES-XTX (also known as XEX), and identical to AES-XTS at block index 0, where the tweak is not multiplied by the primitive element α.
550+
Since only a single block is encrypted, the construction is equivalent to AES-XEX, and identical to AES-XTS at block index 0, where the tweak is not multiplied by the primitive element α.
551551

552552
For single-block AES-XTS, independent sampling of a 16-byte tweak results in an expected collision after about 2<sup>64</sup> operations (approximately 18 quintillion).
553553

@@ -1195,7 +1195,7 @@ function AES_XTS_encrypt(key, tweak, block):
11951195
// Encrypt the tweak with the second half of the key
11961196
ET = AES128_encrypt(K2, tweak)
11971197

1198-
// Encrypt the block: AES128(block ⊕ ET, K1) ⊕ ET
1198+
// Encrypt the block: AES128_encrypt(K1, block ⊕ ET) ⊕ ET
11991199
return AES128_encrypt(K1, block ⊕ ET) ⊕ ET
12001200

12011201
function AES_XTS_decrypt(key, tweak, block):
@@ -1205,7 +1205,7 @@ function AES_XTS_decrypt(key, tweak, block):
12051205
// Encrypt the tweak with the second half of the key
12061206
ET = AES128_encrypt(K2, tweak)
12071207

1208-
// Decrypt the block: AES128_decrypt(block ⊕ ET, K1) ⊕ ET
1208+
// Decrypt the block: AES128_decrypt(K1, block ⊕ ET) ⊕ ET
12091209
return AES128_decrypt(K1, block ⊕ ET) ⊕ ET
12101210
~~~
12111211

0 commit comments

Comments
 (0)