SymCrypt/unittest/kat_kmac.dat

375 строки
18 KiB
Plaintext

#
# Known answer test vectors for KMAC
#
# This file contains test vectors for the following algorithms:
# - KMAC128, KMAC256
#
# Test vectors were compiled/generated from the following sources:
# https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/KMAC_samples.pdf
# https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/KMACXOF_samples.pdf
# https://github.com/XKCP/XKCP
#
# Test vector format
# ------------------
# Key : KMAC key
# Msg : Input message
# CustomStr : Customization string
# Outputlen : Desired output length in bits
# If Outputlen is non-zero, it must match the length of the Output.
# Outputlen = 0 indicates KMAC XOF mode, in this case the Output can be arbitrarily long.
# Output : KMAC output
# See Outputlen field above.
#
# The test vector format described above contains all inputs to KMAC and verifies
# the generated output from these inputs. There is a second type of test vector for
# the Range test, explained below:
#
# Range test goes over all possible sizes of input parameters up to the specified
# value, and computes a SHA3-256 hash value generated from the concatenation of
# the outputs from each case. The following variables are used:
#
# MaxInputSize : Input size in bytes, optional, default is zero.
# MaxKeySize : Key size in bytes, optional, default is zero.
# MaxCustomStrSize: Customization string size in bytes, optional, default is zero.
# OutputSize : Output size in bytes from the algorithm to be appended to
# the running SHA3-256 computation.
# Range : SHA3-256 hash of the concatenation of the intermediate outputs.
#
# The values of input byte sequences set according to the following:
#
# - Input is a sequence of bytes of size MaxInputSize+1. The value of an entry
# at index i is (i & 0xff) | 0x80.
# - Key is a sequence of bytes of size MaxKeySize+1. The value of the
# entry at index i is ('K' + i) & 0xff.
# - Customization string is a sequence of bytes of size MaxNameStrSize+1. The value of the
# entry at index i is ('S' + i) & 0xff.
#
# The test generates an output of OutputSize bytes for each size combination of Input, Function
# Name, and Customization string. If the value of a parameter is not specified, it is taken to be zero.
# For this test, KMAC is used in fixed-length mode (i.e., not XOF mode).
#
# MaxInputSize = 504
# OutputSize = 16
# Range = 989f3f71e67847808b63a91accd73174d7031f8d006e45a3a06d07e8bffd927f
#
# In the above test vector, only input size is specified, thus key size and customization
# string size will be zero. The input size will range from 0 to 504 bytes and the input buffer is
# initialized according to the above description. For each of the 505 cases, an output of
# 16 bytes will be generated and these will be appended to a running SHA3-256 computation. Range
# value in the test vector is the hash value of this computation.
#
# If more than one parameter is specified, the test cases will include each combination of sizes
# of those parameters.
#
[Kmac128]
Key = 404142434445464748494a4b4c4d4e4f
Msg = 00010203
CustomStr = ""
Outputlen = 256
Output = f9d2e95f6bd65c2510b1c6613cb6bd3e9a9038b4b02b3ebf45cce82f137234ee
Key = 404142434445464748494a4b4c4d4e4f
Msg = 00010203
CustomStr = "My Tagged Application"
Outputlen = 256
Output = c561be8a1da5cce7e7aba391f8c69a2db2be2ce8f732a0b6c9d9ea7daefc60f5
Key = 404142434445464748494a4b4c4d4e4f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = "My Tagged Application"
Outputlen = 256
Output = 3a15e2049ead413e1b200aba47a84e8c464d0411eee80493feb8de3e0ac7ecff
Key = 404142434445464748494a4b4c4d4e4f
Msg = 00010203
CustomStr = "My Tagged Application"
Outputlen = 512
Output = ea8496289cafd347f86cd04340ef006bbeca9f146e62d355736e850b3b075f06bf851061e1b2faeac1089f44e5\
766570868e9440c749c9f380a568d7b69b0bfc
Key = 404142434445464748494a4b4c4d4e4f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = ""
Outputlen = 512
Output = 3221875dc6ac512bb8aac20000576060bec5efd68e89aa9469929d65f3c4f5e0477e2f448740f4084f6784aa37\
d37bd4be2b0ea3f501441d5ce7d46bc2b893b7
Key = 404142434445464748494a4b4c4d4e4f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = "My Tagged Application"
Outputlen = 512
Output = 74677d5efc4413b2e813fc0251670f70fe5e9e4c863e5e824d7fb174decfdcc667be6b0eb235766407420a1c9d\
dcaaea6d1e023469cbaa3b1cc3fce77c30fd9e
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 00010203
CustomStr = ""
Outputlen = 256
Output = e5780b0d3ea6f7d3a429c5706aa43a00fadbd7d49628839e3187243f456ee14e
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 00010203
CustomStr = "My Tagged Application"
Outputlen = 256
Output = 3b1fba963cd8b0b59e8c1a6d71888b7143651af8ba0a7070c0979e2811324aa5
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = "My Tagged Application"
Outputlen = 256
Output = 1f5b4e6cca02209e0dcb5ca635b89a15e271ecc760071dfd805faa38f9729230
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 00010203
CustomStr = "My Tagged Application"
Outputlen = 512
Output = 2d4a7e8a616e549f30a48f85630607da929b3622a2b291d92fd7e42cc6720c2f98bcc06803c3f207124c9f6f45\
f1d862c20bcd51fe779d0a84bbdef5ecf10371
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = ""
Outputlen = 512
Output = c1595e3f69c245df6dc778326aeb7a26033f54e1fa59a8bcb3035b9ac9751d2d1248cc1bf2b352af9dab8021cf\
bd68fa5f65875a02cd158a86ab117386640108
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = "My Tagged Application"
Outputlen = 512
Output = bc834ff753cb4fce2b44658f71c62c1e5b5cf3ade4f4383c5f09316532f0730b833af6d4f2b018d5d216a41c33\
1c81ba1012ede8c62777caa665ee74e18b4d3c
Key = 404142434445464748494a4b4c4d4e4f
Msg = 000102
CustomStr = ""
Outputlen = 0
Output = 38739d78e1bdaff6a6cd141355d7069a91656805bfc874dcecf049ef761abddea944d67eb5dcb3c4545da89df5\
5c61a072e732022837597ca63b677aa4b74360
Key = 404142434445464748494a4b4c4d4e4f
Msg = 000102
CustomStr = "My Tagged Application"
Outputlen = 0
Output = 8f07be34de32b0ec9ad884ba3646bd8330f2d3c63c5fc2f819e35fc7143be4eae7de77ca8a2780c61af45e83d9\
6bbe7d22a3e70e56322b41886ebd5fb79c6238
Key = 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F
Msg = 00010203
CustomStr = ""
Outputlen = 0
Output = CD83740BBD92CCC8CF032B1481A0F4460E7CA9DD12B08A0C4031178BACD6EC35
Key = 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F
Msg = 00010203
CustomStr = "My Tagged Application"
Outputlen = 0
Output = 31A44527B4ED9F5C6101D11DE6D26F0620AA5C341DEF41299657FE9DF1A3B16C
Key = 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F
Msg = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D\
2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B\
5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F80818283848586878889\
8A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7\
B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
CustomStr = "My Tagged Application"
Outputlen = 0
Output = 47026C7CD793084AA0283C253EF658490C0DB61438B8326FE9BDDF281B83AE0F
# KMAC128 - Msg
MaxInputSize = 504
OutputSize = 16
Range = 989f3f71e67847808b63a91accd73174d7031f8d006e45a3a06d07e8bffd927f
# KMAC128 - Key and CustomStr
MaxKeySize = 504
MaxCustomStrSize = 504
OutputSize = 16
Range = ca7ae10b085d019765cde7a241df3d3e08eb9cefaedd3cc440887179aa12421d
[Kmac256]
Key = 404142434445464748494a4b4c4d4e4f
Msg = 00010203
CustomStr = ""
Outputlen = 256
Output = 00db6337dc10d426134aa815f7d6c02cb10aea8a554b62393fee2a44a548bd6d
Key = 404142434445464748494a4b4c4d4e4f
Msg = 00010203
CustomStr = "My Tagged Application"
Outputlen = 256
Output = b181b28e28cf63462390c7e5a489e9a2fb3727e8a1de60ea8c3fceb4e2d88c45
Key = 404142434445464748494a4b4c4d4e4f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = "My Tagged Application"
Outputlen = 256
Output = 6104d7df7e82a605023fd1998e4c591872276b2ecc18b5132dea972fcbff853a
Key = 404142434445464748494a4b4c4d4e4f
Msg = 00010203
CustomStr = "My Tagged Application"
Outputlen = 512
Output = 230be38566dd308c6f7480e1d83cb65e96a1189da1e0c519ea072c88b78776e1692401fb92a891686c293e9f81\
2766bbb93efba3355611329f0867c79972da18
Key = 404142434445464748494a4b4c4d4e4f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = ""
Outputlen = 512
Output = 9260dc48b4361fae6d204263da7adf4f645ca386a661bf1c3dced4fe1147ebc202322af9d899596502270ca949\
074452b16f4e68e9dc33cd640159b17eb08d1a
Key = 404142434445464748494a4b4c4d4e4f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = "My Tagged Application"
Outputlen = 512
Output = 78924caebaa5faea8faa688c87e1d723e233213b55038c02f983eef0e3e7f8c43db342d9ba439f8cfd64831869\
67e8e74e22d4ccc4df5e0de6cd187116f8265b
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 00010203
CustomStr = ""
Outputlen = 256
Output = b423798ac38d465560a058b982f56f7ff5d62a5cfa813ab8522998ed32e00a38
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 00010203
CustomStr = "My Tagged Application"
Outputlen = 256
Output = f2d95c33c9a201eb10c524b9084b4bacae0092f869122df7d7870b92c842e05b
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = "My Tagged Application"
Outputlen = 256
Output = 6a188d60bb5f29cb5a8d132fb8ca2f710b74d8505cf6960f32ce88839ac69d4a
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 00010203
CustomStr = "My Tagged Application"
Outputlen = 512
Output = 20c570c31346f703c9ac36c61c03cb64c3970d0cfc787e9b79599d273a68d2f7f69d4cc3de9d104a351689f27c\
f6f5951f0103f33f4f24871024d9c27773a8dd
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = ""
Outputlen = 512
Output = 75358cf39e41494e949707927cee0af20a3ff553904c86b08f21cc414bcfd691589d27cf5e15369cbbff8b9a4c\
2eb17800855d0235ff635da82533ec6b759b69
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d\
2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b\
5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f80818283848586878889\
8a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7\
b8b9babbbcbdbebfc0c1c2c3c4c5c6c7
CustomStr = "My Tagged Application"
Outputlen = 512
Output = b58618f71f92e1d56c1b8c55ddd7cd188b97b4ca4d99831eb2699a837da2e4d970fbacfde50033aea585f1a270\
8510c32d07880801bd182898fe476876fc8965
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 000102
CustomStr = ""
Outputlen = 0
Output = b3b1c792441a71e385c85b06f13d7c77ab7d8975b20ca538f1ff763d980ed2094848745a27f10ec9fc73783b3c\
8169acb412ff4f8b32ef7024d529af07033773
Key = 404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f
Msg = 000102
CustomStr = "My Tagged Application"
Outputlen = 0
Output = c94ce871528cca7ea8f8ea500ba36019de9a6179cfa70d3c952657aa85cf140af1aaa373359b442746f69a19d8\
135b30de70efaf2f751cfde3552ab814e2a1fc
Key = 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F
Msg = 00010203
CustomStr = "My Tagged Application"
Outputlen = 0
Output = 1755133F1534752AAD0748F2C706FB5C784512CAB835CD15676B16C0C6647FA96FAA7AF634A0BF8FF6DF39374F\
A00FAD9A39E322A7C92065A64EB1FB0801EB2B
Key = 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F
Msg = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D\
2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B\
5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F80818283848586878889\
8A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7\
B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
CustomStr = ""
Outputlen = 0
Output = FF7B171F1E8A2B24683EED37830EE797538BA8DC563F6DA1E667391A75EDC02CA633079F81CE12A25F45615EC8\
9972031D18337331D24CEB8F8CA8E6A19FD98B
Key = 404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F
Msg = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D\
2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B\
5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F80818283848586878889\
8A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7\
B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7
CustomStr = "My Tagged Application"
Outputlen = 0
Output = D5BE731C954ED7732846BB59DBE3A8E30F83E77A4BFF4459F2F1C2B4ECEBB8CE67BA01C62E8AB8578D2D499BD1\
BB276768781190020A306A97DE281DCC30305D
# KMAC256 - Msg
MaxInputSize = 408
OutputSize = 16
Range = 88f126f9609287e02af8afd7d6442ccab40c56c7af7aa7e6999cdc6c59d57c1a
# KMAC256 - Key and CustomStr
MaxKeySize = 408
MaxCustomStrSize = 408
OutputSize = 16
Range = 2f6ff11aec06f4ab3afd2ca536eab64673d4ea63e6ff71394ba6e6a411660813