Prop332: add test vectors.

This commit is contained in:
Nick Mathewson 2021-08-26 12:15:41 -04:00
parent b30b4b0d55
commit 7a06c12fea

View File

@ -391,6 +391,40 @@ The relay rejects the message if the value given is outside of the
[`circwindow_inc_min`, `circwindow_inc_max`] range. Otherwise, it [`circwindow_inc_min`, `circwindow_inc_max`] range. Otherwise, it
accepts it, and replies with the same message that the client sent. accepts it, and replies with the same message that the client sent.
# X.2: Test vectors
The following test values, in hex, were generated by a Python reference
implementation.
Inputs:
b = "4051daa5921cfa2a1c27b08451324919538e79e788a81b38cbed097a5dff454a"
B = "f8307a2bc1870b00b828bb74dbb8fd88e632a6375ab3bcd1ae706aaa8b6cdd1d"
ID = "9fad2af287ef942632833d21f946c6260c33fae6172b60006e86e4a6911753a2"
x = "b825a3719147bcbe5fb1d0b0fcb9c09e51948048e2e3283d2ab7b45b5ef38b49"
X = "252fe9ae91264c91d4ecb8501f79d0387e34ad8ca0f7c995184f7d11d5da4f46"
CM = "68656c6c6f20776f726c64"
VER = "78797a7a79"
y = "4865a5b7689dafd978f529291c7171bc159be076b92186405d13220b80e2a053"
Y = "4bf4814326fdab45ad5184f5518bd7fae25dc59374062698201a50a22954246d"
SM = "486f6c61204d756e646f"
Intermediate values:
ENC_K1 = "4cd166e93f1c60a29f8fb9ec40ea0fc878930c27800594593e1c4d0f3b5fbd02"
MAC_K1 = "f5b69e85fdd26e1b0bdbbc8128e32d8123040255f11f744af3cc98fc13613cda"
msg_mac = "9e044d53565f04d82bbb3bebed3d06cea65db8be9c72b68cd461942088502f67"
key_seed = "b9a092741098e1f5b8ab37ce74399dd57522c974d7ae4626283a1077b9273255"
verify = "1dc09fb249738a79f1bc3a545eee8c415f27213894a760bb4df58862e414799a"
ENC_KEY (server) = "cab8a93eef62246a83536c4384f331ec26061b66098c61421b6cae81f4f57c56"
AUTH = "2fc5f8773ca824542bc6cf6f57c7c29bbf4e5476461ab130c5b18ab0a9127665"
Messages:
client_handshake = "9fad2af287ef942632833d21f946c6260c33fae6172b60006e86e4a6911753a2f8307a2bc1870b00b828bb74dbb8fd88e632a6375ab3bcd1ae706aaa8b6cdd1d252fe9ae91264c91d4ecb8501f79d0387e34ad8ca0f7c995184f7d11d5da4f463bebd9151fd3b47c180abc9e044d53565f04d82bbb3bebed3d06cea65db8be9c72b68cd461942088502f67"
server_handshake = "4bf4814326fdab45ad5184f5518bd7fae25dc59374062698201a50a22954246d2fc5f8773ca824542bc6cf6f57c7c29bbf4e5476461ab130c5b18ab0a91276651202c3e1e87c0d32054c"
First 256 bytes of keystream:
KEYSTREAM = "9c19b631fd94ed86a817e01f6c80b0743a43f5faebd39cfaa8b00fa8bcc65c3bfeaa403d91acbd68a821bf6ee8504602b094a254392a07737d5662768c7a9fb1b2814bb34780eaee6e867c773e28c212ead563e98a1cd5d5b4576f5ee61c59bde025ff2851bb19b721421694f263818e3531e43a9e4e3e2c661e2ad547d8984caa28ebecd3e4525452299be26b9185a20a90ce1eac20a91f2832d731b54502b09749b5a2a2949292f8cfcbeffb790c7790ed935a9d251e7e336148ea83b063a5618fcff674a44581585fd22077ca0e52c59a24347a38d1a1ceebddbf238541f226b8f88d0fb9c07a1bcd2ea764bbbb5dacdaf5312a14c0b9e4f06309b0333b4a"