File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1010import re
1111import argparse
1212from mbedtls_framework .asymmetric_key_data import ASYMMETRIC_KEY_DATA
13- from mbedtls_framework . build_tree import guess_project_root
13+ from mbedtls_framework import build_tree
1414
1515BYTES_PER_LINE = 16
1616
@@ -49,7 +49,6 @@ def get_ec_key_family(key: str) -> str:
4949EC_NAME_CONVERSION = {
5050 'PSA_ECC_FAMILY_SECP_K1' : {
5151 192 : ('secp' , 'k1' ),
52- 224 : ('secp' , 'k1' ),
5352 256 : ('secp' , 'k1' )
5453 },
5554 'PSA_ECC_FAMILY_SECP_R1' : {
@@ -168,14 +167,19 @@ def collect_keys() -> Tuple[str, str]:
168167 return '' .join (arrays ), '\n ' .join (look_up_table )
169168
170169def main () -> None :
171- default_output_path = guess_project_root () + "/tests/include/test/test_keys.h"
170+ default_output_path = build_tree . guess_project_root () + "/tests/include/test/test_keys.h"
172171
173172 argparser = argparse .ArgumentParser ()
174173 argparser .add_argument ("--output" , help = "Output file" , default = default_output_path )
175174 args = argparser .parse_args ()
176175
177176 output_file = args .output
178177
178+ # Support for 224 bit EC curves (secp224r1 and secp224k1) was removed from
179+ # tf-psa-crypto. It only remains available for 3.6 LTS branch.
180+ if not build_tree .is_mbedtls_3_6 ():
181+ del EC_NAME_CONVERSION ['PSA_ECC_FAMILY_SECP_R1' ][224 ]
182+
179183 arrays , look_up_table = collect_keys ()
180184
181185 write_output_file (output_file , arrays , look_up_table )
You can’t perform that action at this time.
0 commit comments