Collect the algorithms

Use Algorithm from crypto_knowledge to use its functionality.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This commit is contained in:
Gabor Mezei 2024-09-24 19:46:54 +02:00
parent b50043b960
commit 402381d2a6
No known key found for this signature in database
GPG Key ID: 6310BD29B0BFF98C

View File

@ -56,6 +56,8 @@ from typing import Union
import scripts_path # pylint: disable=unused-import
import config
from mbedtls_framework import c_build_helper
from mbedtls_framework import crypto_knowledge
from mbedtls_framework import psa_information
class Colors: # pylint: disable=too-few-public-methods
"""Minimalistic support for colored output.
@ -481,6 +483,12 @@ class DomainData:
build_command = [options.make_command, 'CFLAGS=-Werror -O2']
build_and_test = [build_command, [options.make_command, 'test']]
self.all_config_symbols = set(conf.settings.keys())
psa_info = psa_information.Information().constructors
algs = {crypto_knowledge.Algorithm(alg): symbol
for alg, symbol in ((alg, psa_information.psa_want_symbol(alg))
for alg in psa_info.algorithms)
if symbol in self.all_config_symbols}
# Find hash modules by name.
hash_symbols = self.config_symbols_matching(r'MBEDTLS_(MD|RIPEMD|SHA)[0-9]+_C\Z')
# Find elliptic curve enabling macros by name.