summaryrefslogtreecommitdiff
path: root/TestVectors
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-10-23 07:35:41 -0400
committerJeffrey Walton <noloader@gmail.com>2018-10-23 07:35:41 -0400
commit35b874b527f659be6dc19190cce4f59b833afd10 (patch)
tree28399c12a0d0a851f8581899c4d2ede00b3bfce2 /TestVectors
parentdc840e49a6c70208cba27b1aedb731abbf4faf49 (diff)
downloadcryptopp-git-35b874b527f659be6dc19190cce4f59b833afd10.tar.gz
Add additional ChaCha tests
Diffstat (limited to 'TestVectors')
-rw-r--r--TestVectors/chacha.txt178
1 files changed, 178 insertions, 0 deletions
diff --git a/TestVectors/chacha.txt b/TestVectors/chacha.txt
index 58f6a36c..d6e90204 100644
--- a/TestVectors/chacha.txt
+++ b/TestVectors/chacha.txt
@@ -1,6 +1,7 @@
AlgorithmType: SymmetricCipher
Name: ChaCha
Source: http://tools.ietf.org/html/draft-strombergson-chacha-test-vectors
+#
Comment: TC1 - All zero key and IV (16-byte key).
Key: r16 00
IV: r8 00
@@ -8,30 +9,35 @@ Rounds: 8
Plaintext: r64 00
Ciphertext: e28a5fa4a67f8c5defed3e6fb7303486aa8427d31419a729572d777953491120b64ab8e72b8deb85cd6aea7cb6089a101824beeb08814a428aab1fa2c816081b
Test: Encrypt
+#
Comment: TC1 - All zero key and IV (32-byte key).
Key: r32 00
IV: r8 00
Plaintext: r64 00
Ciphertext: 3e00ef2f895f40d67f5bb8e81f09a5a12c840ec3ce9a7f3b181be188ef711a1e984ce172b9216f419f445367456d5619314a42a3da86b001387bfdb80e0cfe42
Test: Encrypt
+#
Comment: TC2 - Single bit in key set. All zero IV (16-byte key).
Key: 0x01000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: 03a7669888605a0765e8357475e58673f94fc8161da76c2a3aa2f3caf9fe5449e0fcf38eb882656af83d430d410927d55c972ac4c92ab9da3713e19f761eaa14
Test: Encrypt
+#
Comment: TC2 - Single bit in key set. All zero IV (32-byte key).
Key: 0x0100000000000000000000000000000000000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: cf5ee9a0494aa9613e05d5ed725b804b12f4a465ee635acc3a311de8740489ea289d04f43c7518db56eb4433e498a1238cd8464d3763ddbb9222ee3bd8fae3c8
Test: Encrypt
+#
Comment: TC3 - Single bit in IV set. All zero key (16-byte key).
Key: r16 00
IV: 0x0100000000000000
Plaintext: r64 00
Ciphertext: 25f5bec6683916ff44bccd12d102e692176663f4cac53e719509ca74b6b2eec85da4236fb29902012adc8f0d86c8187d25cd1c486966930d0204c4ee88a6ab35
Test: Encrypt
+#
Comment: TC3 - Single bit in IV set. All zero key (32-byte key).
Key: r32 00
IV: 0x0100000000000000
@@ -41,7 +47,62 @@ Test: Encrypt
AlgorithmType: SymmetricCipher
Name: ChaCha
+Source: https://cr.yp.to/streamciphers/timings/estreambench/submissions/salsa20/chacha8/ref/chacha.c
+#
+Comment: All one's key and IV (16-byte key).
+Key: r16 ff
+IV: r8 ff
+Rounds: 8
+Plaintext: r512 00
+Ciphertext: \
+ 2204D5B81CE662193E00966034F91302F14A3FB047F58B6E6EF0D72113230416 \
+ 3E0FB640D76FF9C3B9CD99996E6E38FAD13F0E31C82244D33ABBC1B11E8BF12D \
+ 9A81D78E9E56604DDFAE136921F51C9D81AE15119DB8E756DD28024493EE571D \
+ 363AE4BBCD6E7D300F99D2673AEB92CCFC6E43A38DC31BACD66B28F17B22B28A \
+ B9A347AC756CF16B39683DFE4907D76E9318C53E3B892B4C4D477E3649A412DF \
+ 641722732D6B4B4E73541FEEA26F36163B860A6FFEFF2BD736DCB9E40BB49DFB \
+ 18E5060462F7EC41EF61C8EAED8F68987F4BBA84FF37DF645677AA26D59D1608 \
+ 201932E2F91565FC50BCCAE19370BEA3F4F6C9B40C69E1E7EF4993FB5C543246 \
+ 8AD37BDFA57F8C0A27AFABA186B20E08D08009C9AAAEC5BE1DB6A5FFD0F6D122 \
+ F000015BB76329B170CBE114A17C0CBC8A721C3075EEDF5F131944F3BEA2E84C \
+ 009BF03FC47FAD2A7BA01573FA67FE859AD950A3E40190AA2FA3834D2FB604E0 \
+ 51F919D4C93CBC6272156BE543785691F698304071BA0D8722CD2694F711E4A2 \
+ 6E511837F4C46CDF9EB2A4573E2FBFF7F4320ACCD35DD64F9B2A40C7F017B971 \
+ 0CD9BC404FD17DC6E474B7EBFE03F5526409160760FB7915DACED8358B8B78C4 \
+ FA9F0C53D408593CBE63FB1C86D34ACF2B412CD114A542A09BA915D091125542 \
+ A72DBCA31889D0FC5CCC5F07FA227694100EE57E97C6C2B601273AA438F72693
+Test: Encrypt
+#
+Comment: All one's key and IV (32-byte key).
+Key: r32 ff
+IV: r8 ff
+Rounds: 8
+Plaintext: r512 00
+Ciphertext: \
+ E163BBF8C9A739D18925EE8362DAD2CDC973DF05225AFB2AA26396F2A9849A4A \
+ 445E0547D31C1623C537DF4BA85C70A9884A35BCBF3DFAB077E98B0F68135F54 \
+ 81D4933F8B322AC0CD762C27235CE2B31534E0244A9A2F1FD5E94498D47FF108 \
+ 790C009CF9E1A348032A7694CB28024CD96D3498361EDB1785AF752D187AB54B \
+ 4194B9407D743285217760B19D0548294855D4C1620CDFF381657E106CA539E3 \
+ E41CC0EAAFCB1C502BCE537275567F72CAE2C076B7DE295233132517E140ECF1 \
+ B7B4F9DE5E87123D72AE0FA8672BBE5B73C5382DDD779A963C91E40B6B9EAF39 \
+ F53B3982D9E4AC76DFAC3D5070373CF9E54036C9F0E9DBB327371D2E69308699 \
+ 8991D340F91458804B2445641E24189956674BAEC8120AC451F9BDDD14B65E99 \
+ 2C526CABF185EA53FD0ABD2DB88DE9FE88E19D3F26DC6BA4B9014924064D15E6 \
+ 7901B9BF0F4EB76C3E06BE3D1CA73289FF819A9DBF456F73686C5CF9207510F3 \
+ 7D95A24249E11E779D301237AF5A2BD3E6F34D7123811E26BB016C73D54A6D39 \
+ 8B4E9BBCD2EE4C31CBD3326148004684F27847CEAC28C341A894A670A0818324 \
+ 446468D08CA1C72BCBD1CE7EFD73D67D53C671C35EA57700D8B581E52E238A7E \
+ 25DDA3E1C1E35D96BDB9CAD13546971B1E5FDB2E83216FEF93E5457DE48A5ED8 \
+ 1F7E4B95484834A58B6AF8CCE9545BBBDC58929A1DEB2F6AEBF0DC2079F644E3
+Test: Encrypt
+
+#################################################
+
+AlgorithmType: SymmetricCipher
+Name: ChaCha
Source: http://tools.ietf.org/html/draft-strombergson-chacha-test-vectors
+#
Comment: TC1 - All zero key and IV (16-byte key).
Key: r16 00
IV: r8 00
@@ -49,23 +110,27 @@ Rounds: 12
Plaintext: r64 00
Ciphertext: e1047ba9476bf8ff312c01b4345a7d8ca5792b0ad467313f1dc412b5fdce32410dea8b68bd774c36a920f092a04d3f95274fbeff97bc8491fcef37f85970b450
Test: Encrypt
+#
Comment: TC1 - All zero key and IV (32-byte key).
Key: r32 00
IV: r8 00
Plaintext: r64 00
Ciphertext: 9bf49a6a0755f953811fce125f2683d50429c3bb49e074147e0089a52eae155f0564f879d27ae3c02ce82834acfa8c793a629f2ca0de6919610be82f411326be
Test: Encrypt
+#
Comment: TC2 - Single bit in key set. All zero IV (16-byte key).
Key: 0x01000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: 2a865a3b8999fa83ae8aacf33fc6be4f32c8aa9762738d26963270052f4eef8b86af758f7867560af6d0eeb973b5542bb24c8abceac8b1f36d026963d6c8a9b2
Test: Encrypt
+#
Comment: TC2 - Single bit in key set. All zero IV (32-byte key).
Key: 0x0100000000000000000000000000000000000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: 12056e595d56b0f6eef090f0cd25a20949248c2790525d0f930218ff0b4ddd10a6002239d9a454e29e107a7d06fefdfef0210feba044f9f29b1772c960dc29c0
+#
Test: Encrypt
Comment: TC3 - Single bit in IV set. All zero key (16-byte key).
Key: r16 00
@@ -73,6 +138,7 @@ IV: 0x0100000000000000
Plaintext: r64 00
Ciphertext: 91cdb2f180bc89cfe86b8b6871cd6b3af61abf6eba01635db619c40a0b2e19edfa8ce5a9bd7f53cc2c9bcfea181e9754a9e245731f658cc282c2ae1cab1ae02c
Test: Encrypt
+#
Comment: TC3 - Single bit in IV set. All zero key (32-byte key).
Key: r32 00
IV: 0x0100000000000000
@@ -82,7 +148,62 @@ Test: Encrypt
AlgorithmType: SymmetricCipher
Name: ChaCha
+Source: https://cr.yp.to/streamciphers/timings/estreambench/submissions/salsa20/chacha8/ref/chacha.c
+#
+Comment: All one's key and IV (16-byte key).
+Key: r16 ff
+IV: r8 ff
+Rounds: 12
+Plaintext: r512 00
+Ciphertext: \
+ 60E349E60C38B328C4BAAB90D44A7C727662770D36350D65A1433BD92B00ECF4 \
+ 83D5597D7A616258EC3C5D5B30E1C5C85C5DFE2F92423B8E36870F3185B6ADD9 \
+ F34DAB6C2BC551898FBDCDFC783F09171CC8B59A8B2852983C3A9B91D29B5761 \
+ 12464A9D8E050263E989906F42C7EFCAC8A70A85BB7FF2211273FBD4CAD96142 \
+ DB89BA6820D565E1DBA19B70DD2CEB8A9ECA55CA48B92B1B27D4676BE4985508 \
+ 9AA6202B811799D95EA5A239C39861D7E4B56E0847C2CCF8FAAA3768268F80D6 \
+ 87E6DA5D95C303A3A29D2AB10B392F223F426A1E5400D272083DE05B7BEAB22C \
+ 46C667513885DE4EAB9A18660D1247ECFAC6EE049180A4E780158A29D4914F0C \
+ B87860D4C30C5F2BFADA2615D09907F7059BD6EA7278BAD8CAF57145B6C431CE \
+ E4EB781A9ADDB1CBDB0ADED70CDA2F195FF311888C9A23409A00529B654332BB \
+ 0E566990895D96E264D56438619F515E29E023D0C434D56142A1916ED6529476 \
+ 7DA1D97911C069FCBF711AA8682A9EA19A41F400BCDF6D9ABFDC518063F5F75D \
+ 0060D6F03B9B78577B89C577643E69590518CEEA869665458E027EA27D002767 \
+ C22241E8E12C421623B86C667341E0C2E7E3F2FDCC058C26F9A64626CEDFDE08 \
+ 35F6A77CF8BF99FB7ABCD3874366E3B8FDAEDF83B58701C08B1F39027A913868 \
+ CF84F5C9001701A6ACE8C05C05578E47CA7691F9058C8B7298B756B900BC535A
+Test: Encrypt
+#
+Comment: All one's key and IV (32-byte key).
+Key: r32 ff
+IV: r8 ff
+Rounds: 12
+Plaintext: r512 00
+Ciphertext: \
+ 04BF88DAE8E47A228FA47B7E6379434BA664A7D28F4DAB84E5F8B464ADD20C3A \
+ CAA69C5AB221A23A57EB5F345C96F4D1322D0A2FF7A9CD43401CD536639A615A \
+ 5C9429B55CA3C1B55354559669A154ACA46CD761C41AB8ACE385363B95675F06 \
+ 8E18DB5A673C11291BD4187892A9A3A33514F3712B26C13026103298ED76BC9A \
+ 19E1C370231E9F3351C2E71C5D0635D8E9908EBEBFBAA1F493C1ACCD015F7D50 \
+ 4582C1B3D52449D7A707F5D136BF83E019643902FE052AD8577A037343E128F4 \
+ 3514FED8B5B612EBDF26851DE269E2E2398358383CD0067864BFB4E835613E2F \
+ AA2B4759C7A615614176A133F6F30D063A64A8274A558773E537DCC0753A1208 \
+ 9C90E1574D00E2E444EFC18F1CCFA8EC328163A909C45DFCDB1B92049B2D01D5 \
+ DEC0F6F102EB3E63B724B7B0ACD038962CA2A153E6B4756BFBB870D20D30C970 \
+ 1EC3FA344E26B02D4CE834630D2A1889DF42F07D48EA08609FAC95DF29BAEF9B \
+ 89BC66265947A35085F7C19BF30CA6019E48A736FDBB1E49236B3538F2F9FE98 \
+ 2882B0524FD01F213F016326ADCD8503DCD928EFC1A02F824B9E9D998CD73EF2 \
+ 5D52E6E6BB2FF8B0284C7565E26868EFD6C1A86DAD733417FB80606EB5BB3A9F \
+ 5E16F52D6857A1A602A7FC6DDD578CA868F1E51AADD3209034A4740036DE08A7 \
+ A906067C997F01E4E334CBA913407C7A462A968B272834D2D66DF24922F4302C
+Test: Encrypt
+
+#################################################
+
+AlgorithmType: SymmetricCipher
+Name: ChaCha
Source: http://tools.ietf.org/html/draft-strombergson-chacha-test-vectors
+#
Comment: TC1 - All zero key and IV (16-byte key).
Key: r16 00
IV: r8 00
@@ -90,33 +211,90 @@ Rounds: 20
Plaintext: r64 00
Ciphertext: 89670952608364fd00b2f90936f031c8e756e15dba04b8493d00429259b20f46cc04f111246b6c2ce066be3bfb32d9aa0fddfbc12123d4b9e44f34dca05a103f
Test: Encrypt
+#
Comment: TC1 - All zero key and IV (32-byte key).
Key: r32 00
IV: r8 00
Plaintext: r64 00
Ciphertext: 76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b8f41518a11cc387b669b2ee6586
Test: Encrypt
+#
Comment: TC2 - Single bit in key set. All zero IV (16-byte key).
Key: 0x01000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: ae56060d04f5b597897ff2af1388dbceff5a2a4920335dc17a3cb1b1b10fbe70ece8f4864d8c7cdf0076453a8291c7dbeb3aa9c9d10e8ca36be4449376ed7c42
Test: Encrypt
+#
Comment: TC2 - Single bit in key set. All zero IV (32-byte key).
Key: 0x0100000000000000000000000000000000000000000000000000000000000000
IV: r8 00
Plaintext: r64 00
Ciphertext: c5d30a7ce1ec119378c84f487d775a8542f13ece238a9455e8229e888de85bbd29eb63d0a17a5b999b52da22be4023eb07620a54f6fa6ad8737b71eb0464dac0
Test: Encrypt
+#
Comment: TC3 - Single bit in IV set. All zero key (16-byte key).
Key: r16 00
IV: 0x0100000000000000
Plaintext: r64 00
Ciphertext: 1663879eb3f2c9949e2388caa343d361bb132771245ae6d027ca9cb010dc1fa7178dc41f8278bc1f64b3f12769a24097f40d63a86366bdb36ac08abe60c07fe8
Test: Encrypt
+#
Comment: TC3 - Single bit in IV set. All zero key (32-byte key).
Key: r32 00
IV: 0x0100000000000000
Plaintext: r64 00
Ciphertext: ef3fdfd6c61578fbf5cf35bd3dd33b8009631634d21e42ac33960bd138e50d32111e4caf237ee53ca8ad6426194a88545ddc497a0b466e7d6bbdb0041b2f586b
Test: Encrypt
+
+AlgorithmType: SymmetricCipher
+Name: ChaCha
+Source: https://cr.yp.to/streamciphers/timings/estreambench/submissions/salsa20/chacha8/ref/chacha.c
+#
+Comment: All one's key and IV (16-byte key).
+Key: r16 ff
+IV: r8 ff
+Rounds: 20
+Plaintext: r512 00
+Ciphertext: \
+ 992947C3966126A0E660A3E95DB048DE091FB9E0185B1E41E41015BB7EE50150 \
+ 399E4760B262F9D53F26D8DD19E56F5C506AE0C3619FA67FB0C408106D0203EE \
+ 40EA3CFA61FA32A2FDA8D1238A2135D9D4178775240F99007064A6A7F0C731B6 \
+ 7C227C52EF796B6BED9F9059BA0614BCF6DD6E38917F3B150E576375BE50ED67 \
+ B0EDE573FD64189655C22A452CA343A3F63DE7A2BF75DB4BC5EC87AE6B3818E0 \
+ E4FB1DE2CC047982D6A9FEF37B9D3A11D6329AB81A9ED9FDAB565EE99DDEA1FE \
+ D207921A4169C3F1B212A886E6AE48FB19E9AF414915B087F9AF7F74EEA49732 \
+ ED08500D8EEBD8083F9101984E30D4162D3C0A8BE4F18B22491A61DF53A7E629 \
+ 3406AF356940F23C66A4E2A4CE7284C30DCAC3C58B4491D755B02BC91F864E24 \
+ 9097953A8D81737B8CFA80407571E3CC6BA716D1FAAD50209B737665563684B0 \
+ 201D668B79D23D68BA41C92EDB2C66119C662E19B3A317FE1D7F4B7E52211FC2 \
+ 16EE14FB9E7B063D8010036C5C18F73084448A514A4EA32A8FB74E40ADBDBAEE \
+ 14F371872A3864D80695049098ED1B69E425E55BE5B27DD41255E24A27484CDB \
+ EBD332BCCFE8CC4FFC4669E2EAC7B6202BF1D966AA24C0110DFB80E68A12973B \
+ 5A9793643E862A891DBCF2321F362B9977306405EACD5BB0CB09316803F70F0D \
+ 2CE2AF1C267EB944314DDC515412600FCB7D0A3EC16FDD105F5A4C8507DB36AA
+Test: Encrypt
+#
+Comment: All one's key and IV (32-byte key).
+Key: r32 ff
+IV: r8 ff
+Rounds: 20
+Plaintext: r512 00
+Ciphertext: \
+ D9BF3F6BCE6ED0B54254557767FB57443DD4778911B606055C39CC25E674B836 \
+ 3FEABC57FDE54F790C52C8AE43240B79D49042B777BFD6CB80E931270B7F50EB \
+ 5BAC2ACD86A836C5DC98C116C1217EC31D3A63A9451319F097F3B4D6DAB07787 \
+ 19477D24D24B403A12241D7CCA064F790F1D51CCAFF6B1667D4BBCA1958C4306 \
+ 2D83C32143F7D743A87F710C3202AF7D30046775865F3934958597BB38FFE32C \
+ 7C5B456E3E5457D203BB45D304D014D46709EA4DB71A935EFC388CEFA5B894E5 \
+ D1076A95EC7791AB0AD55C2A2FAC3C61E35BAE153036763326D632C9E004BC6D \
+ A45D5FC9486C29F002E40A7AB619DDCA1A660765F853C77E1FF44C2A4F49344F \
+ 7530DC05190BD9A256FE38CEDE7DAA540904135BEC993088E712276467166A63 \
+ 04F1FC26C9DDA89CEE93D15441C88FC15E143DB941BBB42424A36E5C8F5AAA49 \
+ 2BFEED0BA93348AA786F40114F4895A6B21A11DB8937A510B2A099F75C1E03E7 \
+ A6E3E281EC9C66D400F36C232798C6496048028C8D7320F43E97A56D6C4D1183 \
+ 8FD5DD8F45DF7DE235225B5F1C41C3AFED4EC0526AB38DCB8597770803F1261C \
+ D22CFEAEC86612E53DEFC29848C055053C6B1D462A3CF09B228E47211AFBA0AF \
+ 4E4C2B336E6EE2F471823808523F073C1BC8785D258AC2BD580209A82A875273 \
+ 93DF828B6A6728ABD7AAD0485BFF5CE92C8DB78B1E63929FC76A905E8C7AF310
+Test: Encrypt \ No newline at end of file