/mbedtls-3.6.0/scripts/mbedtls_dev/ |
D | macro_collector.py | 14 def __init__(self, filename: str, line_number: Union[int, str]) -> None: argument 16 super(ReadFileLineException, self).__init__(message) 17 self.filename = filename 18 self.line_number = line_number 40 def __init__(self, filename: str, binary: bool = False) -> None: argument 41 self.filename = filename 42 self.file = None #type: Optional[IO[str]] 43 self.line_number = 'entry' #type: Union[int, str] 44 self.generator = None #type: Optional[Iterable[Tuple[int, str]]] 45 self.binary = binary [all …]
|
D | bignum_core.py | 40 def __init__(self, input_hex: str, descr: str, count: int) -> None: argument 41 self.input_hex = input_hex 42 self.number_description = descr 43 self.shift_count = count 44 self.result = bignum_common.hex_to_int(input_hex) >> count 46 def arguments(self) -> List[str]: argument 47 return ['"{}"'.format(self.input_hex), 48 str(self.shift_count), 49 '"{:0{}x}"'.format(self.result, len(self.input_hex))] 51 def description(self) -> str: argument [all …]
|
D | ecp.py | 79 def arg_a(self) -> str: argument 80 return super().format_arg('{:x}'.format(self.int_a)).zfill(2 * self.hex_digits) 82 def result(self) -> List[str]: argument 83 result = self.int_a % self.int_n 84 return [self.format_result(result)] 87 def is_valid(self) -> bool: argument 90 def arguments(self)-> List[str]: argument 156 def arg_a(self) -> str: argument 157 limbs = 2 * bignum_common.bits_to_limbs(224, self.bits_in_limb) 158 hex_digits = bignum_common.hex_digits_for_limb(limbs, self.bits_in_limb) [all …]
|
D | bignum_mod_raw.py | 28 def arguments(self) -> List[str]: argument 29 return [bignum_common.quote_str(n) for n in [self.arg_a, 30 self.arg_b, 31 self.arg_n] 32 ] + self.result() 34 def result(self) -> List[str]: argument 35 result = (self.int_a - self.int_b) % self.int_n 36 return [self.format_result(result)] 61 def result(self) -> List[str]: argument 62 result = self.int_a % self.int_n [all …]
|
D | crypto_knowledge.py | 71 def __init__(self, name: str, params: Optional[Iterable[str]] = None) -> None: argument 82 self.name = name.strip() 89 if '(' in self.name: 90 m = re.match(r'(\w+)\s*\((.*)\)\Z', self.name) 92 self.name = m.group(1) 94 self.params = (None if params is None else 100 assert re.match(r'PSA_KEY_TYPE_\w+\Z', self.name) 102 self.expression = self.name 104 if self.params is not None: 105 self.expression += '(' + ', '.join(self.params) + ')' [all …]
|
D | bignum_common.py | 129 def __init__(self, val_a: str, val_b: str = "0", bits_in_limb: int = 32) -> None: argument 130 self.val_a = val_a 131 self.val_b = val_b 134 self.int_a = hex_to_int(val_a) 135 self.int_b = hex_to_int(val_b) 136 self.dependencies = deepcopy(self.dependencies) 137 if bits_in_limb not in self.limb_sizes: 139 if self.input_style == "arch_split": 140 self.dependencies.append("MBEDTLS_HAVE_INT{:d}".format(bits_in_limb)) 141 self.bits_in_limb = bits_in_limb [all …]
|
D | psa_storage.py | 25 def __init__(self, content: Union[int, str]): argument 28 self.string = '{0:#0{1}x}'.format(content, digits + 2) 29 self.value_if_known = content #type: Optional[int] 31 self.string = content 32 self.unknown_values.add(self.normalize(content)) 33 self.value_if_known = None 41 def update_cache(self) -> None: argument 43 expressions = sorted(self.unknown_values) 55 self.value_cache[e] = int(v, 0) 56 self.unknown_values.clear() [all …]
|
D | bignum_mod.py | 28 def arguments(self) -> List[str]: argument 29 return [self.format_result(self.to_montgomery(self.int_a)), 30 self.format_result(self.to_montgomery(self.int_b)), 31 bignum_common.quote_str(self.arg_n) 32 ] + self.result() 34 def result(self) -> List[str]: argument 35 result = (self.int_a * self.int_b) % self.int_n 36 return [self.format_result(self.to_montgomery(result))] 47 def result(self) -> List[str]: argument 48 result = (self.int_a - self.int_b) % self.int_n [all …]
|
D | test_case.py | 28 def __init__(self, description: Optional[str] = None): argument 29 self.comments = [] #type: List[str] 30 self.description = description #type: Optional[str] 31 self.dependencies = [] #type: List[str] 32 self.function = None #type: Optional[str] 33 self.arguments = [] #type: List[str] 35 def add_comment(self, *lines: str) -> None: argument 36 self.comments += lines 38 def set_description(self, description: str) -> None: argument 39 self.description = description [all …]
|
/mbedtls-3.6.0/tests/scripts/ |
D | test_generate_test_code.py | 34 def test_dependencies_list(self): argument 44 self.assertEqual(preprocessor1, '#if defined(DEP1)', 46 self.assertEqual(preprocessor2, '#if defined(DEP2)', 48 self.assertEqual(endif1, '#endif /* DEP2 */', 50 self.assertEqual(endif2, '#endif /* DEP1 */', 53 def test_disabled_dependencies_list(self): argument 63 self.assertEqual(preprocessor1, '#if !defined(DEP1)', 65 self.assertEqual(preprocessor2, '#if !defined(DEP2)', 67 self.assertEqual(endif1, '#endif /* !DEP2 */', 69 self.assertEqual(endif2, '#endif /* !DEP1 */', [all …]
|
D | check_names.py | 69 def __init__(self, filename, line, line_no, pos, name): argument 71 self.filename = filename 72 self.line = line 73 self.line_no = line_no 74 self.pos = pos 75 self.name = name 77 def __str__(self): argument 81 gutter = format(self.line_no, "4d") 82 underline = self.pos[0] * " " + (self.pos[1] - self.pos[0]) * "^" 86 " {0} | {1}".format(gutter, self.line) + [all …]
|
D | generate_tls13_compat_tests.py | 68 def __init__(self, ciphersuite=None, signature_algorithm=None, named_group=None, argument 70 self._ciphers = [] 71 self._sig_algs = [] 72 self._named_groups = [] 73 self._cert_sig_algs = [] 75 self.add_ciphersuites(ciphersuite) 77 self.add_named_groups(named_group) 79 self.add_signature_algorithms(signature_algorithm) 81 self.add_cert_signature_algorithms(cert_sig_alg) 82 self._compat_mode = compat_mode [all …]
|
D | generate_psa_tests.py | 52 def __init__(self, info: psa_information.Information) -> None: argument 53 self.constructors = info.constructors 63 self, argument 74 if kt.name in self.ALWAYS_SUPPORTED: 119 def test_cases_for_not_supported(self) -> Iterator[test_case.TestCase]: argument 121 for key_type in sorted(self.constructors.key_types): 122 if key_type in self.ECC_KEY_TYPES: 124 if key_type in self.DH_KEY_TYPES: 127 yield from self.test_cases_for_key_type_not_supported(kt) 128 for curve_family in sorted(self.constructors.ecc_curves): [all …]
|
D | check_files.py | 51 def __init__(self): argument 52 self.files_with_issues = {} 65 def should_check_file(self, filepath): argument 71 for files_exemption in self.suffix_exemptions: 74 if self.path_exemptions and \ 75 re.match(self.path_exemptions, self.normalize_path(filepath)): 79 def check_file_for_issue(self, filepath): argument 86 def record_issue(self, filepath, line_number): argument 88 if filepath not in self.files_with_issues.keys(): 89 self.files_with_issues[filepath] = [] [all …]
|
D | generate_bignum_tests.py | 76 def description_suffix(self) -> str: argument 81 def description(self) -> str: argument 88 if not self.case_description: 89 self.case_description = "{} {} {}".format( 90 self.value_description(self.arg_a), 91 self.symbol, 92 self.value_description(self.arg_b) 94 description_suffix = self.description_suffix() 96 self.case_description += " " + description_suffix 137 def __init__(self, val_a, val_b) -> None: argument [all …]
|
D | audit-validity-dates.py | 55 def __init__(self, data_type: DataType, x509_obj): argument 56 self.data_type = data_type 58 self.locations = [] # type: typing.List[str] 59 self.fill_validity_duration(x509_obj) 60 self._obj = x509_obj 62 self._identifier = hashlib.sha1(self._obj.public_bytes(encoding)).hexdigest() 65 def identifier(self): argument 70 return self._identifier 72 def fill_validity_duration(self, x509_obj): argument 76 if self.data_type == DataType.CRT: [all …]
|
D | check_test_cases.py | 22 def __init__(self, options): argument 23 self.errors = 0 24 self.warnings = 0 25 self.ignore_warnings = options.quiet 27 def error(self, file_name, line_number, fmt, *args): argument 30 self.errors += 1 32 def warning(self, file_name, line_number, fmt, *args): argument 33 if not self.ignore_warnings: 36 self.warnings += 1 49 def process_test_case(self, per_file_state, argument [all …]
|
D | depends.py | 71 def __init__(self, options=None): argument 82 self.red = ('\033[31m', normal) 83 self.green = ('\033[32m', normal) 84 self.cyan = ('\033[36m', normal) 85 self.bold_red = ('\033[1;31m', normal) 86 self.bold_green = ('\033[1;32m', normal) 156 def __init__(self, name, config_settings, commands): argument 166 self.name = name 167 self.config_settings = config_settings 168 self.commands = commands [all …]
|
D | generate_pkcs7_tests.py | 26 def __init__(self, name, depends, func_call): argument 27 self.name = name 28 self.depends = depends 29 self.func_call = func_call 32 def to_string(self): argument 33 return "\n" + self.name + "\n" + self.depends + "\n" + self.func_call + "\n" 43 def __init__(self, file_name): argument 44 self.file_name = file_name 45 self.last_test_num, self.old_tests = self.read_test_file(file_name) 46 self.new_tests = [] [all …]
|
/mbedtls-3.6.0/scripts/ |
D | code_size_compare.py | 54 self, argument 71 self.version = version 72 self.git_rev = git_rev 73 self.arch = arch 74 self.config = config 75 self.compiler = compiler 76 self.opt_level = opt_level 78 self.pre_make_cmd = [] #type: typing.List[str] 79 self.make_cmd = '' 81 def get_info_indication(self): argument [all …]
|
D | abi_check.py | 110 def __init__(self, old_version, new_version, configuration): argument 123 self.repo_path = "." 124 self.log = None 125 self.verbose = configuration.verbose 126 self._setup_logger() 127 self.report_dir = os.path.abspath(configuration.report_dir) 128 self.keep_all_reports = configuration.keep_all_reports 129 self.can_remove_report_dir = not (os.path.exists(self.report_dir) or 130 self.keep_all_reports) 131 self.old_version = old_version [all …]
|
D | generate_psa_constants.py | 213 def __init__(self): argument 233 def _make_status_cases(self): argument 234 return '\n '.join(map(self._make_return_case, 235 sorted(self.statuses))) 237 def _make_ecc_curve_cases(self): argument 238 return '\n '.join(map(self._make_return_case, 239 sorted(self.ecc_curves))) 241 def _make_dh_group_cases(self): argument 242 return '\n '.join(map(self._make_return_case, 243 sorted(self.dh_groups))) [all …]
|
D | config.py | 34 def __init__(self, active, name, value='', section=None): argument 35 self.active = active 36 self.name = name 37 self.value = value 38 self.section = section 57 def __init__(self): argument 58 self.settings = {} 60 def __contains__(self, name): argument 66 return name in self.settings and self.settings[name].active 68 def all(self, *names): argument [all …]
|
D | assemble_changelog.py | 35 def __init__(self, filename, line_number, message, *args, **kwargs): argument 41 def __init__(self, line_offset, error_message): argument 42 self.line_offset = line_offset 43 self.error_message = error_message 47 def __init__(self, filename, line): argument 195 def add_categories_from_text(self, filename, line_offset, argument 199 categories = self.format.split_categories(text) 205 category.name not in self.categories: 214 if not self._only_url_re.match(line) and \ 217 if self._has_url_re.match(line) else "" [all …]
|
D | generate_ssl_debug_helpers.py | 155 def __init__(self, source_code, span=None, group=None): argument 164 self._prototype = suffix_name if suffix_name else 'enum ' + prefix_name 165 self._name = suffix_name if suffix_name else prefix_name 166 self._body = body 167 self._source = source_code 168 self._span = span 170 def __repr__(self): argument 171 return 'Enum({},{})'.format(self._name, self._span) 173 def __str__(self): argument 174 return repr(self) [all …]
|