Rename LMS private key files

And remove now-unnecessary modification to check_files.py

Signed-off-by: Raef Coles <raef.coles@arm.com>
This commit is contained in:
Raef Coles 2022-10-13 16:40:48 +01:00
parent e4d96b804c
commit ce18e528ff
9 changed files with 22 additions and 23 deletions

View file

@ -119,7 +119,6 @@ BINARY_FILE_PATH_RE_LIST = [
r'tests/data_files/.*\.req\.[^/]+\Z',
r'tests/data_files/.*malformed[^/]+\Z',
r'tests/data_files/format_pkcs12\.fmt\Z',
r'tests/data_files/lms_.*\Z',
]
BINARY_FILE_PATH_RE = re.compile('|'.join(BINARY_FILE_PATH_RE_LIST))

View file

@ -17,7 +17,7 @@ LMOTS hsslms interop test #1
# This test uses data from https://github.com/pmvr/python-hsslms due to the
# limited amount of available test vectors for LMOTS, and few implementations
# providing direct access to the underlying OTS signature scheme. The private
# key is stored in data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8.prv.
# key is stored in data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8_prv.
# This test uses the same OTS key as the LMS hsslms interop test 1 (leaf 0 of
# the LMS key), and the same message.
#
@ -28,7 +28,7 @@ LMOTS hsslms interop test #1
# from hsslms import LMS_Priv, LM_OTS_Priv, LMS_ALGORITHM_TYPE, LMOTS_ALGORITHM_TYPE
# import pickle
#
# with open('tests/data_files/lms_lmshss_sha256_m32_h5_lmots_sha256_n32_w8.prv', 'rb') as private_key_file:
# with open('tests/data_files/lms_lmshss_sha256_m32_h5_lmots_sha256_n32_w8_prv', 'rb') as private_key_file:
# private_key = pickle.load(private_key_file)
#
# ots_private_key = LM_OTS_Priv(private_key.otstypecode, private_key.I, 0, private_key.SEED)
@ -42,7 +42,7 @@ LMOTS hsslms interop test #2
# This test uses data from https://github.com/pmvr/python-hsslms due to the
# limited amount of available test vectors for LMOTS, and few implementations
# providing direct access to the underlying OTS signature scheme. The private
# key is stored in data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8.prv.
# key is stored in data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8_prv.
# This test uses the same OTS key as the LMS hsslms interop test 2 (leaf 1 of
# the LMS key), and the same message.
#
@ -53,7 +53,7 @@ LMOTS hsslms interop test #2
# from hsslms import LMS_Priv, LM_OTS_Priv, LMS_ALGORITHM_TYPE, LMOTS_ALGORITHM_TYPE
# import pickle
#
# with open('tests/data_files/lms_lmshss_sha256_m32_h5_lmots_sha256_n32_w8.prv', 'rb') as private_key_file:
# with open('tests/data_files/lms_lmshss_sha256_m32_h5_lmots_sha256_n32_w8_prv', 'rb') as private_key_file:
# private_key = pickle.load(private_key_file)
#
#ots_private_key = LM_OTS_Priv(private_key.otstypecode, private_key.I, 1, private_key.SEED)
@ -67,7 +67,7 @@ LMOTS hsslms interop NULL-message test
# This test uses data from https://github.com/pmvr/python-hsslms due to the
# limited amount of available test vectors for LMOTS, and few implementations
# providing direct access to the underlying OTS signature scheme. The private
# key is stored in data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8.prv.
# key is stored in data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8_prv.
#
# To produce another signature with this message and key (note that the actual
# signature bytes will differ due to randomization):
@ -76,7 +76,7 @@ LMOTS hsslms interop NULL-message test
# from hsslms import LMS_Priv, LM_OTS_Priv, LMS_ALGORITHM_TYPE, LMOTS_ALGORITHM_TYPE
# import pickle
#
# with open('tests/data_files/lms_lmshss_sha256_m32_h5_lmots_sha256_n32_w8.prv', 'rb') as private_key_file:
# with open('tests/data_files/lms_lmshss_sha256_m32_h5_lmots_sha256_n32_w8_prv', 'rb') as private_key_file:
# private_key = pickle.load(private_key_file)
#
#ots_private_key = LM_OTS_Priv(private_key.otstypecode, private_key.I, 3, private_key.SEED)

View file

@ -65,7 +65,7 @@ lms_verify_test:"3f4fe37f1bb9547e443e53697a12f0393efbcf87c23d91765eb36100dd5d2c4
LMS pyhsslms interop NULL-message test
# This test uses data from https://github.com/russhousley/pyhsslms due to the limited
# amount of available test vectors for LMS. The private key is stored in
# data_files/lms_pyhsslms_sha256_m32_h5_lmots_sha256_n32_w8.prv. Note that this signature
# data_files/lms_pyhsslms_sha256_m32_h5_lmots_sha256_n32_w8_prv. Note that this signature
# uses leaf key 2, so must be the third signature generated by the key if the
# signature is to be reproduced. Message data is random. Note that hash-sigs
# stores public keys and signatures in HSS form, which appends a 4-byte
@ -75,7 +75,7 @@ LMS pyhsslms interop NULL-message test
# To produce another signature with this message and key (note that the actual
# signature bytes will differ due to randomization):
# * pip3 install --user pyhsslms
# * cp data_files/lms_pyhsslms_sha256_m32_h5_lmots_sha256_n32_w8.prv tmp/lms.prv
# * cp data_files/lms_pyhsslms_sha256_m32_h5_lmots_sha256_n32_w8_prv tmp/lms.prv
# * touch message.bin (create empty message file)
# * hsslms sign tmp/lms.prv message.bin (incorrect signature using leaf node 0)
# * rm message.bin.sig
@ -96,8 +96,8 @@ lms_verify_test:"":"0000000200000004b219a0053b6bfe1988ade7b0a438c106262366cb6338
LMS hash-sigs interop test #1
# This test uses data from https://github.com/cisco/hash-sigs due to the
# limited amount of available test vectors for LMS. The private key is stored in
# data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8.prv and
# data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8.aux. Note that this
# data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8_prv and
# data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8_aux. Note that this
# signature uses leaf key 0, so must be the first signature generated by the key
# if the signature is to be reproduced. Message data is random. Note that
# hash-sigs stores public keys and signatures in HSS form, which appends a
@ -107,8 +107,8 @@ LMS hash-sigs interop test #1
# To produce another signature with this message and key (note that the actual
# signature bytes will differ due to randomization):
# * <download and build hash-sigs>
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8.prv tmp/lms.prv
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8.aux tmp/lms.aux
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8_prv tmp/lms.prv
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8_aux tmp/lms.aux
# * <Save message in binary format>
# * <hash-sigs>/demo sign tmp/lms message.bin
# * cat message.bin.sig | xxd
@ -117,15 +117,15 @@ LMS hash-sigs interop test #1
# * Save message and signature in binary format
# * echo -n -e "\0\0\0\0" > message.bin.sig; cat sig.bin >> message.bin.sig (restore the
# HSS levels)
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8.pub tmp/lms.pub
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8_pub tmp/lms.pub
# * <hash-sigs/demo> verify tmp/lms message.bin
lms_verify_test:"6b7439e31ef128c54f1536f745ff1246":"0000000000000004163fc2e3d3267d8c0d9fd9e7bb7a4eae84c3d98cd565de361edc426067960fc3201d9be1c30f4e4edce91844753aa13ff21e92648ac795b7c29dd6140962b5a1fb97b02570402a498a495044edcb26d1321c52e91c60cc3feb8f8e84fc77f97fb6e7afbfe4c2f2203d8d84303e2dd212b652e08a2e5a24a333df859cea3c5a547561f7ce6d182e2a3f2f018ef7e0578621916cff905c0713fa5f2bf73248ae6985aebc4086b79ebf71b8dcbb592eb61dc6303d06dbda88063690361b0dd25ea1c2c6b4d82dddbe11740864c65c228d67e9a1710506e585a748e7e02b36706e5cff83b3589613f07c636ab7784d6a8288d33e80f063165a2ddcbb0d7da815df8043dfa500c3e313c533bf6aec959237c923813d3109bdaeb195b1337f4cf21c1c863f6261dca411819603a3ea60cf34c81b462c4979b357da2bcdf3128343ca5a8a957e3ca4eebb914d743862e29ef48e43e7c5a7aaf7a2fe1251c309c65e9143dcfb298fa0d353084f60c0779e1a09b040f13c1025ec99402b844ff9996decf4b5f0d32a0858126ff293472aa93fbc2017d39fee93ff9f0ca2752b25cfa12542bf19cc1b8c102d65b70dccf760f26cb546742ce909d45345f802a985bae6a0f922a9c2a3dc992fae9f6f2fba0c52cad82564bde6ed8af880ee7a5eb5c6436611e5da1c690831bed34e3dd65acf2b8f496b6448e957afc16c48b6cd733bc84e3606a1d0609f08015c14b5619a2723f9b22950efc7ff7b733c299fcd84ed89c4d5cd43a9a54f25fc0fa1370d184f9e8011b60ba38dfca0eeeb56ae37a5823718c8210db20c2de13c39e43970b0b53b85b9cf9ea0dd025e7db558b463c683980fe59e0defde41afe825cfb8606ca861602a7fefd7506edc81b7ab4a1e0626e0bac1f99be118dbc1e291028fc73d0a0ea6559ae1dcf7477d64742c9bef88ef04b2ee4d392cf1efa23d8b05d11d2414e64f4540623e11bbf57fb8ae219331db0df459a9849f2700e6fa7ff4edb0fc01764949e279e84374e7a57fb5ee6221b2b72dbcf2ab9c988fe07d21e169b4338887129ac503cc6c0912787778d51b4b921cf7bb17d4028b7faf6c21dd616a1ac3b50d595ae0e3662e7faa16b9dec7694462c7fb8539ece0af33cc5a3dc33641b8827bf4751a708d7bf286cf2e795b8f45b76e1109abd908d0388d6ab8ecea67b187aabd80349e4bd286e3b6eeb3535cc9c343a39fe90cb443906b19d2483b4c93d0e35cd68d9f5523d5400a2b1708ba3361bd0757ed69b1da8845594edf053995b2d96bed8210aaab25fc34b2dd58004ce800360f24861e5912ac339ed0a78548e303e728a41e05c11d79013e3971eafa8034e63ecf1c842f0d9e735ff3b5badfd63ae07f051c94a9a867260b517e5c2c75e88e03d069bd39816a2255c90de81bb79622145b7469853a02eac45289fd9f9f40e2fccdd8ddb740469331f61badc1b7f6e0145dfe30141ad2f26ac8d7ff5125dc4dff1fec57629cea4f7de4401fc056e9a38ea028ac9c666ccd3f527947672408a759a5791d9efdeb1ff25392413728a03d4c641f4ce1542b6952e7595f1eecf1060000000671b0912d734442146e128d0029101ad34a6d2d586640235c828d427dfaffdb156771f06926678fa50aa7167684c1de108944b2c4a3358f5e926368009e4500a8d4d501124bc25a4c9b1cfb954503f4ae26c92221e39c680843ae55cfca972e139c82e2e4469a703a1866fa0e6d76636591f4ad07f7d1eaa19077660ad46a6f9d534970e6a49e24621b7c7c283253dd22fb24eb7819fab84bab88e42555d5437d5afe06615a7e0d103cc8595616690f1337f4345cf418724f07d0dc4d2c0899b691691f397202204ef34342b5725dc6adfe549ab0b887572ad38113c407f96fcdfeea0ffc4f333addfec296169e53e3c5b24797a20f3b2f043f5e96920de9927da466f09389d3e52a5665f380f68666a019c201e710ab4c168d5ac952a02d5909a6fcaf498a33e2124e6a828203744ee3fe70465adde0cfbccc1b4634541638ab":"0000000600000004e18760ef2c86192aee88579e376f35cd153419d622803a483e79f6d368629308a8ab6ff663c4f108b2033af290dcedfa":0
LMS hash-sigs interop test #2
# This test uses data from https://github.com/cisco/hash-sigs due to the
# limited amount of available test vectors for LMS. The private key is stored in
# data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8.prv and
# data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8.aux. Note that this
# data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8_prv and
# data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8_aux. Note that this
# signature uses leaf key 1, so must be the second signature generated by the key
# if the signature is to be reproduced. Message data is random. Note that
# hash-sigs stores public keys and signatures in HSS form, which appends a
@ -135,8 +135,8 @@ LMS hash-sigs interop test #2
# To produce another signature with this message and key (note that the actual
# signature bytes will differ due to randomization):
# * <download and build hash-sigs>
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8.prv tmp/lms.prv
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8.aux tmp/lms.aux
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8_prv tmp/lms.prv
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8_aux tmp/lms.aux
# * <Save message in binary format>
# * <hash-sigs>/demo sign tmp/lms message.bin (incorrect signature using leaf node 0)
# * rm message.bin.sig
@ -147,14 +147,14 @@ LMS hash-sigs interop test #2
# * Save message and signature in binary format
# * echo -n -e "\0\0\0\0" > message.bin.sig; cat sig.bin >> message.bin.sig (restore the
# HSS levels)
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8.pub tmp/lms.pub
# * cp data_files/lms_hash-sigs_sha256_m32_h5_lmots_sha256_n32_w8_pub tmp/lms.pub
# * <hash-sigs/demo> verify tmp/lms message.bin
lms_verify_test:"0705ba8297c7b9fa5f08e37825ad24a0":"00000001000000040a432454b99750f7b703f0280f92818b0570d0267a423b377be7cf0561305d4ce987b9d8dbc1c3f8ba410bbe6b921406eb802688d2dd8a1a6fa4a124cbcae9b5a210f583a956384c06311953b038b4ad2c2808224fc3a6410cd3b89274371956bcd4253a251cba6409b09c822e1d29d7a037648a6f2562d0df6359a043622f256f5ac79736c08fc4185758ff002a8397e560d5812373946348afba2ccf2cc0f3ba741ec076d4587a54b8b625804b814c30540152a3dc843a590c94cc23ba857e4c458c8ab687b5b9b68837ee890454cc19bb5f42a1e6dc051803fab50b440067a903013f675a774b5d02cd56289518d65f869f22b2e2b58d499e9e3929ec5a9f5d6d6e03cf91486094aba7c88491cde35b81c175c40410bc402d20f0a73a4da844d3a1d47e57618b7f18fa5ac85e877b5faa1e0b6733c2d96b2970fdd6e606435e3ec50eafa88f84fb7512217aa4be5858a140f242603bda634d76c484a184298c4da903094468d032b88586fd2f35182405cd85115af6a0bbd431f2e44217a1691dd8887db91d3b97264ff552ae7dc110a3a111f2bf74ce42079055dfb8390a16d67f28b738f837aa7880f3134deabcf6ec74cdb521bff44df61c999bf7a8ddc43b64812cd4f3bfb15104867d5e585d1cbf99738e0df92660b3e9135a4377d1199b8b97362fc87ce3c99db3b8aba63ba35eb353e5ec79bcee82b9ccc1b4f7d1b8ce7e5f8813d007be3d0e45cb8e7173337a5a7c4d32ea5116e0fdbd7846ea1f366a531449c78cd7a16ce5bffcd6cccf54b7f249a74e0df6b07f6b48db42eb958ff18b06995368af0cadd82f44cf44e4b53f0993de5f06b289bee41cd25f90a9fbd1bfb1ab2451c96b07adcfb5210d291dd505ea30e5d30395c8d84eabccdd2c7d6f28a88f5e5d245a6980c57810cfe17c9a37ef5e79b7b9ca755d56a789d21985372bed42ae2830d81ebf0fad6c721bd1d3ee91ae363f40d386aac23e7c0db965539ce9bff38f0f24bec3227b5a24f4cd7fa71ca9d306faa3fc4726cdb6634f218897b79a4aed67a58799285104eed74703ec4af6d5738b27b4d6fb71e52c1149069483a7cca6c3fccbdff77312ff5c635d8b0ccd53dbaf7b498727f7c7a70d3fd1c3f217e2cbd0dfe91258acb7f79f53f56012a82da997ea777b76dac0472e5f9830a93fb09703b1c0e45cbfbf641de94fcc6c609f02a5b31ad5821ba6cd48829fc5e0c4ad78e11e4cac8efbb1b170c794b7b131b0c1c4e39fdef81db9e7acced5ec824aed0c4e6b57fd1add4191e87be1446c7c519eb671205ce8c5855ad7a2b9ff7a9cd5c45336f508d0f8d2c1152dc2656650bdaf8fced642f3a4d445b5fc49910bdbdc9635de0086ee9582a796ca9f6052de805f41dfbd3e94982a05cbd36bab583dd5b1586ddbb3b1a45f1a265bec062c1a50d220870c0c622d852e650a67f31e8eb3d19e964de0926712b7f429ad05024b8db51eb6702c39580f62f037388862251bf66f02edee9615a63957eab75b28501f9f26cecd09a5c949127c9a3095036667fce8e45ba75568d5160fa1725a9e0038145d948f437640dc4441000000066e8db13a9e79d10a4e067aad448a1847b5489a62cde3054ee1e5ff2e37549d516771f06926678fa50aa7167684c1de108944b2c4a3358f5e926368009e4500a8d4d501124bc25a4c9b1cfb954503f4ae26c92221e39c680843ae55cfca972e139c82e2e4469a703a1866fa0e6d76636591f4ad07f7d1eaa19077660ad46a6f9d534970e6a49e24621b7c7c283253dd22fb24eb7819fab84bab88e42555d5437d5afe06615a7e0d103cc8595616690f1337f4345cf418724f07d0dc4d2c0899b691691f397202204ef34342b5725dc6adfe549ab0b887572ad38113c407f96fcdfeea0ffc4f333addfec296169e53e3c5b24797a20f3b2f043f5e96920de9927da466f09389d3e52a5665f380f68666a019c201e710ab4c168d5ac952a02d5909a6fcaf498a33e2124e6a828203744ee3fe70465adde0cfbccc1b4634541638ab":"0000000600000004e18760ef2c86192aee88579e376f35cd153419d622803a483e79f6d368629308a8ab6ff663c4f108b2033af290dcedfa":0
LMS hsslms interop test #1
# This test uses data from https://github.com/pmvr/python-hsslms due to the
# limited amount of available test vectors for LMS. The private key is stored in
# data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8.prv
# data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8_prv
#
# To produce another signature with this message and key (note that the actual
# signature bytes will differ due to randomization):
@ -163,7 +163,7 @@ LMS hsslms interop test #1
# from hsslms import LMS_Priv, LMS_ALGORITHM_TYPE, LMOTS_ALGORITHM_TYPE
# import pickle
#
# with open('tests/data_files/lms_lmshss_sha256_m32_h5_lmots_sha256_n32_w8.prv', 'rb') as private_key_file:
# with open('tests/data_files/lms_lmshss_sha256_m32_h5_lmots_sha256_n32_w8_prv', 'rb') as private_key_file:
# private_key = pickle.load(private_key_file)
#
# public_key = private_key.gen_pub()
@ -177,7 +177,7 @@ lms_verify_test:"60da1a17c88c59da8a730e6ca8effd37":"00000000000000041394a893e40b
LMS hsslms interop test #2
# This test uses data from https://github.com/pmvr/python-hsslms due to the
# limited amount of available test vectors for LMS. The private key is stored in
# data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8.prv
# data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8_prv
#
# To produce another signature with this message and key (note that the actual
# signature bytes will differ due to randomization):
@ -186,7 +186,7 @@ LMS hsslms interop test #2
# from hsslms import LMS_Priv, LMS_ALGORITHM_TYPE, LMOTS_ALGORITHM_TYPE
# import pickle
#
# with open('tests/data_files/lms_lmshss_sha256_m32_h5_lmots_sha256_n32_w8.prv', 'rb') as private_key_file:
# with open('tests/data_files/lms_lmshss_sha256_m32_h5_lmots_sha256_n32_w8_prv', 'rb') as private_key_file:
# private_key = pickle.load(private_key_file)
#
# public_key = private_key.gen_pub()