Skip to content

Commit 62f93d9

Browse files
Add explicit size assertionf for VALID_KEY and VALID_NONCE
1 parent f85491c commit 62f93d9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

crypto/tests/test_chacha20.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import random
2+
import string
3+
from crypto.ChaCha20 import ChaCha20
4+
5+
VALID_KEY = b"\x00" *32
6+
assert len(VALID_KEY) == 32, "VALID_KEY must be exactly 32 bytes"
7+
VALID_NONCE = B"\x00" * 12
8+
assert len(VALID_NONCE) == 12, "VALID_NONCE must be exactly 12 bytes"
9+
10+
secure_rng = random.SystemRandom()

0 commit comments

Comments
 (0)