You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-denis-dprive-dnscrypt.md
+38-52Lines changed: 38 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -308,81 +308,67 @@ This document has no IANA actions.
308
308
309
309
The `Box-XChaChaPoly` algorithm combines the `X25519` {{!RFC7748}} key exchange mechanism with a variant of the ChaCha20-Poly1305 construction specified in {{!RFC8439}}.
310
310
311
-
## HChaCha20
311
+
## Conventions and Definitions
312
312
313
-
`HChaCha20`is an intermediate step based on the construction and security proof used to create `XSalsa20`, an extended-nonce Salsa20 variant.
313
+
- `x[a..]`: the subarray of `x` starting at index `a`, and extending to the last index of `x`
314
+
- `x[a..b]`: the subarray of `x` starting at index `a` and ending at index `b`.
315
+
- `LOAD32_LE(p)`: returns a 32-bit unsigned integer from the 4-byte array `p`
316
+
- `STORE32_LE(p, x)`: stores the 32-bit unsigned integer `x` into the 4-byte array `p`
314
317
315
-
`HChaCha20`is initialized in the same way as the ChaCha20 cipher defined in {{!RFC8439}}, except that `HChaCha20` uses a 128-bit nonce and has no counter. Instead, the block counter is replaced by the first 32 bits of the nonce.
318
+
## HChaCha20
316
319
317
-
Consider the two figures below, where each non-whitespace character represents one nibble of information about the ChaCha states (all numbers little-endian):
320
+
`HChaCha20`is based on the construction and security proof used to create XSalsa20, an extended-nonce variant of Salsa20.
318
321
319
-
~~~
320
-
cccccccc cccccccc cccccccc cccccccc
321
-
kkkkkkkk kkkkkkkk kkkkkkkk kkkkkkkk
322
-
kkkkkkkk kkkkkkkk kkkkkkkk kkkkkkkk
323
-
bbbbbbbb nnnnnnnn nnnnnnnn nnnnnnnn
322
+
The `HChaCha20` function takes the following input paramters:
The function can be implemented using an existing IETF-compliant `ChaCha20` implementation as follows:
332
330
333
-
HChaCha20 State: c=constant k=key n=nonce
334
331
~~~
335
-
336
-
After initialization, proceed through the ChaCha rounds as usual. Once the 20 ChaCha rounds have been completed, the first 128 bits and last 128 bits of the ChaCha state (both little-endian) are concatenated, and this 256-bit subkey is returned.
0 commit comments