/mbedtls-3.4.0/scripts/mbedtls_dev/ |
D | macro_collector.py | 25 def __init__(self, filename: str, line_number: Union[int, str]) -> None: argument 27 super(ReadFileLineException, self).__init__(message) 28 self.filename = filename 29 self.line_number = line_number 51 def __init__(self, filename: str, binary: bool = False) -> None: argument 52 self.filename = filename 53 self.file = None #type: Optional[IO[str]] 54 self.line_number = 'entry' #type: Union[int, str] 55 self.generator = None #type: Optional[Iterable[Tuple[int, str]]] 56 self.binary = binary [all …]
|
D | bignum_core.py | 50 def __init__(self, input_hex: str, descr: str, count: int) -> None: argument 51 self.input_hex = input_hex 52 self.number_description = descr 53 self.shift_count = count 54 self.result = bignum_common.hex_to_int(input_hex) >> count 56 def arguments(self) -> List[str]: argument 57 return ['"{}"'.format(self.input_hex), 58 str(self.shift_count), 59 '"{:0{}x}"'.format(self.result, len(self.input_hex))] 61 def description(self) -> str: argument [all …]
|
D | psa_storage.py | 35 def __init__(self, content: Union[int, str]): argument 38 self.string = '{0:#0{1}x}'.format(content, digits + 2) 39 self.value_if_known = content #type: Optional[int] 41 self.string = content 42 self.unknown_values.add(self.normalize(content)) 43 self.value_if_known = None 51 def update_cache(self) -> None: argument 53 expressions = sorted(self.unknown_values) 62 self.value_cache[e] = int(v, 0) 63 self.unknown_values.clear() [all …]
|
D | bignum_common.py | 103 def __init__(self, val_a: str, val_b: str = "0", bits_in_limb: int = 32) -> None: argument 104 self.val_a = val_a 105 self.val_b = val_b 108 self.int_a = hex_to_int(val_a) 109 self.int_b = hex_to_int(val_b) 110 if bits_in_limb not in self.limb_sizes: 112 if self.input_style == "arch_split": 113 self.dependencies = ["MBEDTLS_HAVE_INT{:d}".format(bits_in_limb)] 114 self.bits_in_limb = bits_in_limb 117 def boundary(self) -> int: argument [all …]
|
D | crypto_knowledge.py | 82 def __init__(self, name: str, params: Optional[Iterable[str]] = None) -> None: argument 93 self.name = name.strip() 100 if '(' in self.name: 101 m = re.match(r'(\w+)\s*\((.*)\)\Z', self.name) 103 self.name = m.group(1) 105 self.params = (None if params is None else 111 assert re.match(r'PSA_KEY_TYPE_\w+\Z', self.name) 113 self.expression = self.name 115 if self.params is not None: 116 self.expression += '(' + ', '.join(self.params) + ')' [all …]
|
D | test_case.py | 39 def __init__(self, description: Optional[str] = None): argument 40 self.comments = [] #type: List[str] 41 self.description = description #type: Optional[str] 42 self.dependencies = [] #type: List[str] 43 self.function = None #type: Optional[str] 44 self.arguments = [] #type: List[str] 46 def add_comment(self, *lines: str) -> None: argument 47 self.comments += lines 49 def set_description(self, description: str) -> None: argument 50 self.description = description [all …]
|
D | bignum_mod_raw.py | 42 def arguments(self) -> List[str]: argument 43 return [bignum_common.quote_str(n) for n in [self.arg_a, 44 self.arg_b, 45 self.arg_n] 46 ] + self.result() 48 def result(self) -> List[str]: argument 49 result = (self.int_a - self.int_b) % self.int_n 50 return [self.format_result(result)] 73 def result(self) -> List[str]: argument 74 result = (self.int_a + self.int_b) % self.int_n [all …]
|
D | test_data_generation.py | 66 def arguments(self) -> List[str]: argument 77 def description(self) -> str: argument 88 if self.show_test_count: 90 self.test_name, self.count, self.case_description 93 return "{} {}".format(self.test_name, self.case_description).strip() 96 def create_test_case(self) -> test_case.TestCase: argument 99 tc.set_description(self.description()) 100 tc.set_function(self.test_function) 101 tc.set_arguments(self.arguments()) 102 tc.set_dependencies(self.dependencies) [all …]
|
/mbedtls-3.4.0/tests/scripts/ |
D | test_generate_test_code.py | 46 def test_dependencies_list(self): argument 56 self.assertEqual(preprocessor1, '#if defined(DEP1)', 58 self.assertEqual(preprocessor2, '#if defined(DEP2)', 60 self.assertEqual(endif1, '#endif /* DEP2 */', 62 self.assertEqual(endif2, '#endif /* DEP1 */', 65 def test_disabled_dependencies_list(self): argument 75 self.assertEqual(preprocessor1, '#if !defined(DEP1)', 77 self.assertEqual(preprocessor2, '#if !defined(DEP2)', 79 self.assertEqual(endif1, '#endif /* !DEP2 */', 81 self.assertEqual(endif2, '#endif /* !DEP1 */', [all …]
|
D | check_names.py | 81 def __init__(self, filename, line, line_no, pos, name): argument 83 self.filename = filename 84 self.line = line 85 self.line_no = line_no 86 self.pos = pos 87 self.name = name 89 def __str__(self): argument 93 gutter = format(self.line_no, "4d") 94 underline = self.pos[0] * " " + (self.pos[1] - self.pos[0]) * "^" 98 " {0} | {1}".format(gutter, self.line) + [all …]
|
D | generate_tls13_compat_tests.py | 79 def __init__(self, ciphersuite=None, signature_algorithm=None, named_group=None, argument 81 self._ciphers = [] 82 self._sig_algs = [] 83 self._named_groups = [] 84 self._cert_sig_algs = [] 86 self.add_ciphersuites(ciphersuite) 88 self.add_named_groups(named_group) 90 self.add_signature_algorithms(signature_algorithm) 92 self.add_cert_signature_algorithms(cert_sig_alg) 93 self._compat_mode = compat_mode [all …]
|
D | generate_bignum_tests.py | 89 def description_suffix(self) -> str: argument 94 def description(self) -> str: argument 101 if not self.case_description: 102 self.case_description = "{} {} {}".format( 103 self.value_description(self.arg_a), 104 self.symbol, 105 self.value_description(self.arg_b) 107 description_suffix = self.description_suffix() 109 self.case_description += " " + description_suffix 150 def __init__(self, val_a, val_b) -> None: argument [all …]
|
D | check_files.py | 63 def __init__(self): argument 64 self.files_with_issues = {} 77 def should_check_file(self, filepath): argument 83 for files_exemption in self.suffix_exemptions: 86 if self.path_exemptions and \ 87 re.match(self.path_exemptions, self.normalize_path(filepath)): 91 def check_file_for_issue(self, filepath): argument 98 def record_issue(self, filepath, line_number): argument 100 if filepath not in self.files_with_issues.keys(): 101 self.files_with_issues[filepath] = [] [all …]
|
D | generate_psa_tests.py | 103 def __init__(self) -> None: argument 104 self.constructors = self.read_psa_interface() 117 def read_psa_interface(self) -> macro_collector.PSAMacroEnumerator: argument 127 self.remove_unwanted_macros(constructors) 157 def __init__(self, info: Information) -> None: argument 158 self.constructors = info.constructors 166 self, argument 177 if kt.name in self.ALWAYS_SUPPORTED: 217 def test_cases_for_not_supported(self) -> Iterator[test_case.TestCase]: argument 219 for key_type in sorted(self.constructors.key_types): [all …]
|
D | check_test_cases.py | 33 def __init__(self, options): argument 34 self.errors = 0 35 self.warnings = 0 36 self.ignore_warnings = options.quiet 38 def error(self, file_name, line_number, fmt, *args): argument 41 self.errors += 1 43 def warning(self, file_name, line_number, fmt, *args): argument 44 if not self.ignore_warnings: 47 self.warnings += 1 60 def process_test_case(self, per_file_state, argument [all …]
|
D | depends.py | 85 def __init__(self, options=None): argument 96 self.red = ('\033[31m', normal) 97 self.green = ('\033[32m', normal) 98 self.bold_red = ('\033[1;31m', normal) 99 self.bold_green = ('\033[1;32m', normal) 164 def __init__(self, name, config_settings, commands): argument 174 self.name = name 175 self.config_settings = config_settings 176 self.commands = commands 178 def announce(self, colors, what): argument [all …]
|
D | psa_collect_statuses.py | 41 def __init__(self): argument 42 self.functions = {} 43 self.codes = set() 44 self.status_names = {} 46 def collect_log(self, log_file_name): argument 55 if function not in self.functions: 56 self.functions[function] = {} 57 fdata = self.functions[function] 58 if value not in self.functions[function]: 61 self.codes.add(int(value)) [all …]
|
D | test_psa_constant_names.py | 119 def __init__(self, options) -> None: argument 120 self.options = options 121 self.count = 0 122 self.errors = [] #type: List[Tests.Error] 124 def run_one(self, inputs: InputsForTest, type_word: str) -> None: argument 132 include_path=self.options.include, 133 keep_c=self.options.keep_c) 134 output_bytes = subprocess.check_output([self.options.program, 138 self.count += len(expressions) 140 if self.options.show: [all …]
|
D | analyze_outcomes.py | 19 def __init__(self): argument 20 self.error_count = 0 21 self.warning_count = 0 27 def error(self, fmt, *args, **kwargs): argument 28 self.log('Error: ' + fmt, *args, **kwargs) 29 self.error_count += 1 31 def warning(self, fmt, *args, **kwargs): argument 32 self.log('Warning: ' + fmt, *args, **kwargs) 33 self.warning_count += 1 39 def __init__(self): argument [all …]
|
/mbedtls-3.4.0/scripts/ |
D | abi_check.py | 122 def __init__(self, old_version, new_version, configuration): argument 135 self.repo_path = "." 136 self.log = None 137 self.verbose = configuration.verbose 138 self._setup_logger() 139 self.report_dir = os.path.abspath(configuration.report_dir) 140 self.keep_all_reports = configuration.keep_all_reports 141 self.can_remove_report_dir = not (os.path.exists(self.report_dir) or 142 self.keep_all_reports) 143 self.old_version = old_version [all …]
|
D | generate_psa_constants.py | 225 def __init__(self): argument 245 def _make_status_cases(self): argument 246 return '\n '.join(map(self._make_return_case, 247 sorted(self.statuses))) 249 def _make_ecc_curve_cases(self): argument 250 return '\n '.join(map(self._make_return_case, 251 sorted(self.ecc_curves))) 253 def _make_dh_group_cases(self): argument 254 return '\n '.join(map(self._make_return_case, 255 sorted(self.dh_groups))) [all …]
|
D | code_size_compare.py | 39 def __init__(self, old_revision, new_revision, result_dir): argument 45 self.repo_path = "." 46 self.result_dir = os.path.abspath(result_dir) 47 os.makedirs(self.result_dir, exist_ok=True) 49 self.csv_dir = os.path.abspath("code_size_records/") 50 os.makedirs(self.csv_dir, exist_ok=True) 52 self.old_rev = old_revision 53 self.new_rev = new_revision 54 self.git_command = "git" 55 self.make_command = "make" [all …]
|
D | config.py | 45 def __init__(self, active, name, value='', section=None): argument 46 self.active = active 47 self.name = name 48 self.value = value 49 self.section = section 68 def __init__(self): argument 69 self.settings = {} 71 def __contains__(self, name): argument 77 return name in self.settings and self.settings[name].active 79 def all(self, *names): argument [all …]
|
D | assemble_changelog.py | 47 def __init__(self, filename, line_number, message, *args, **kwargs): argument 53 def __init__(self, line_offset, error_message): argument 54 self.line_offset = line_offset 55 self.error_message = error_message 59 def __init__(self, filename, line): argument 207 def add_categories_from_text(self, filename, line_offset, argument 211 categories = self.format.split_categories(text) 217 category.name not in self.categories: 226 if not self._only_url_re.match(line) and \ 229 if self._has_url_re.match(line) else "" [all …]
|
D | generate_ssl_debug_helpers.py | 167 def __init__(self, source_code, span=None, group=None): argument 176 self._prototype = suffix_name if suffix_name else 'enum ' + prefix_name 177 self._name = suffix_name if suffix_name else prefix_name 178 self._body = body 179 self._source = source_code 180 self._span = span 182 def __repr__(self): argument 183 return 'Enum({},{})'.format(self._name, self._span) 185 def __str__(self): argument 186 return repr(self) [all …]
|