Skip to content

Commit

Permalink
Merge pull request #6963 from davidhorstmann-arm/2.28-fix-check-pytho…
Browse files Browse the repository at this point in the history
…n-errors

[Backport 2.28] Fix check python errors
  • Loading branch information
gilles-peskine-arm authored Jan 26, 2023
2 parents c2738f2 + 659d905 commit 0f16ce0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions scripts/mbedtls_dev/crypto_knowledge.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import enum
import re
from typing import FrozenSet, Iterable, List, Optional, Tuple
from typing import FrozenSet, Iterable, List, Optional, Tuple, Dict

from .asymmetric_key_data import ASYMMETRIC_KEY_DATA

Expand Down Expand Up @@ -148,7 +148,7 @@ def is_public(self) -> bool:
'PSA_ECC_FAMILY_BRAINPOOL_P_R1': (160, 192, 224, 256, 320, 384, 512),
'PSA_ECC_FAMILY_MONTGOMERY': (255, 448),
'PSA_ECC_FAMILY_TWISTED_EDWARDS': (255, 448),
}
} # type: Dict[str, Tuple[int, ...]]
KEY_TYPE_SIZES = {
'PSA_KEY_TYPE_AES': (128, 192, 256), # exhaustive
'PSA_KEY_TYPE_ARC4': (8, 128, 2048), # extremes + sensible
Expand All @@ -160,7 +160,7 @@ def is_public(self) -> bool:
'PSA_KEY_TYPE_HMAC': (128, 160, 224, 256, 384, 512), # standard size for each supported hash
'PSA_KEY_TYPE_RAW_DATA': (8, 40, 128), # sample
'PSA_KEY_TYPE_RSA_KEY_PAIR': (1024, 1536), # small sample
}
} # type: Dict[str, Tuple[int, ...]]
def sizes_to_test(self) -> Tuple[int, ...]:
"""Return a tuple of key sizes to test.
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/generate_psa_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def make_test_case(
dependencies[i] = '!' + dep
tc.set_dependencies(dependencies)
tc.set_function(category.name.lower() + '_fail')
arguments = []
arguments = [] # type: List[str]
if kt:
key_material = kt.key_material(kt.sizes_to_test()[0])
arguments += [key_type, test_case.hex_string(key_material)]
Expand Down

0 comments on commit 0f16ce0

Please sign in to comment.