upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/44.md
diff options
context:
space:
mode:
authorjiftechnify <jiftech.stlfy@gmail.com>2023-12-25 12:00:05 +0900
committerjiftechnify <jiftech.stlfy@gmail.com>2023-12-25 12:00:05 +0900
commit95218740e2a78dbe941f09b09360541731d8f55e (patch)
tree906233647f6b11b159c40e5d5c95598366d4c6f4 /44.md
parentd52b09732a3a35b27110d4b595268d2d9599f0f3 (diff)
fix typos
Diffstat (limited to '44.md')
-rw-r--r--44.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/44.md b/44.md
index 8bc4038..0efa482 100644
--- a/44.md
+++ b/44.md
@@ -80,7 +80,7 @@ NIP-44 version 2 has the following design characteristics:
80 but won't leak the long-term key 80 but won't leak the long-term key
813. Calculate message keys 813. Calculate message keys
82 - The keys are generated from `conversation_key` and `nonce`. Validate that both are 32 bytes long 82 - The keys are generated from `conversation_key` and `nonce`. Validate that both are 32 bytes long
83 - Use HKDF-expand, with sha256, `OKM=conversation_key`, `info=nonce` and `L=76` 83 - Use HKDF-expand, with sha256, `PRK=conversation_key`, `info=nonce` and `L=76`
84 - Slice 76-byte HKDF output into: `chacha_key` (bytes 0..32), `chacha_nonce` (bytes 32..44), `hmac_key` (bytes 44..76) 84 - Slice 76-byte HKDF output into: `chacha_key` (bytes 0..32), `chacha_nonce` (bytes 32..44), `hmac_key` (bytes 44..76)
854. Add padding 854. Add padding
86 - Content must be encoded from UTF-8 into byte array 86 - Content must be encoded from UTF-8 into byte array
@@ -115,9 +115,9 @@ validation rules, refer to BIP-340.
115 - Validate length of base64 message to prevent DoS on base64 decoder: it can be in range from 132 to 87472 chars 115 - Validate length of base64 message to prevent DoS on base64 decoder: it can be in range from 132 to 87472 chars
116 - Validate length of decoded message to verify output of the decoder: it can be in range from 99 to 65603 bytes 116 - Validate length of decoded message to verify output of the decoder: it can be in range from 99 to 65603 bytes
1173. Calculate conversation key 1173. Calculate conversation key
118 - See step 1 of (encryption)[#Encryption] 118 - See step 1 of [encryption](#Encryption)
1194. Calculate message keys 1194. Calculate message keys
120 - See step 3 of (encryption)[#Encryption] 120 - See step 3 of [encryption](#Encryption)
1215. Calculate MAC (message authentication code) with AAD and compare 1215. Calculate MAC (message authentication code) with AAD and compare
122 - Stop and throw an error if MAC doesn't match the decoded one from step 2 122 - Stop and throw an error if MAC doesn't match the decoded one from step 2
123 - Use constant-time comparison algorithm 123 - Use constant-time comparison algorithm
@@ -126,7 +126,7 @@ validation rules, refer to BIP-340.
1267. Remove padding 1267. Remove padding
127 - Read the first two BE bytes of plaintext that correspond to plaintext length 127 - Read the first two BE bytes of plaintext that correspond to plaintext length
128 - Verify that the length of sliced plaintext matches the value of the two BE bytes 128 - Verify that the length of sliced plaintext matches the value of the two BE bytes
129 - Verify that calculated padding from step 3 of the (encryption)[#Encryption] process matches the actual padding 129 - Verify that calculated padding from step 3 of the [encryption](#Encryption) process matches the actual padding
130 130
131### Details 131### Details
132 132
@@ -291,5 +291,5 @@ The file also contains intermediate values. A quick guidance with regards to its
291- `valid.encrypt_decrypt`: emulate real conversation. Calculate pub2 from sec2, verify conversation_key from (sec1, pub2), encrypt, verify payload, then calculate pub1 from sec1, verify conversation_key from (sec2, pub1), decrypt, verify plaintext. 291- `valid.encrypt_decrypt`: emulate real conversation. Calculate pub2 from sec2, verify conversation_key from (sec1, pub2), encrypt, verify payload, then calculate pub1 from sec1, verify conversation_key from (sec2, pub1), decrypt, verify plaintext.
292- `valid.encrypt_decrypt_long_msg`: same as previous step, but instead of a full plaintext and payload, their checksum is provided. 292- `valid.encrypt_decrypt_long_msg`: same as previous step, but instead of a full plaintext and payload, their checksum is provided.
293- `invalid.encrypt_msg_lengths` 293- `invalid.encrypt_msg_lengths`
294- `invalid.get_conversation_key`: calculating converastion_key must throw an error 294- `invalid.get_conversation_key`: calculating conversation_key must throw an error
295- `invalid.decrypt`: decrypting message content must throw an error 295- `invalid.decrypt`: decrypting message content must throw an error