Lines Matching full:name

33     # Dear Pylint, conventionally, a context manager class name is lowercase.
34 # pylint: disable=invalid-name,too-few-public-methods
49 snippet annotates the exception with the file name and line number.
108 # macro name -> list of argument names
110 # argument name -> list of values
123 def is_internal_name(self, name: str) -> bool:
126 if name.endswith('_BASE') or name.endswith('_NONE'):
128 if '_CATEGORY_' in name:
130 return name.endswith('_FLAG') or name.endswith('_MASK')
150 def _format_arguments(name: str, arguments: Iterable[str]) -> str:
156 return name + '(' + ', '.join(arguments) + ')'
163 def distribute_arguments(self, name: str) -> Iterator[str]:
166 If name is a macro without arguments, just yield "name".
167 If name is a macro with arguments, yield a series of
168 "name(arg1,...,argN)" where each argument takes each possible
172 if name not in self.argspecs:
173 yield name
175 argspec = self.argspecs[name]
177 yield name + '()'
181 yield self._format_arguments(name, arguments)
188 yield self._format_arguments(name, arguments)
191 raise Exception('distribute_arguments({})'.format(name)) from e
194 self, seen: Set[str], name: str
197 for result in self.distribute_arguments(name):
216 self.distribute_arguments_without_duplicates(seen, name)
217 for name in names
240 def algorithm_tester(name: str) -> str:
243 The given name must be the name of an algorithm constructor of the
251 assert name.startswith(prefix)
253 suffix = name[len(prefix):]
260 def record_algorithm_subtype(self, name: str, expansion: str) -> None:
263 Given a ``PSA_ALG_xxx`` macro name and its expansion, if the algorithm
269 if re.match(r'MAC(?:_|\Z)', name):
270 self.mac_algorithms.add(name)
271 elif re.match(r'KDF(?:_|\Z)', name):
272 self.kdf_algorithms.add(name)
274 self.hash_algorithms.add(name)
276 self.mac_algorithms.add(name)
278 self.aead_algorithms.add(name)
280 self.ka_algorithms.add(name)
282 self.kdf_algorithms.add(name)
284 # "#define" followed by a macro name with either no parameters
286 # Grab the macro name in group 1, the parameter name if any in group 2
302 name, parameter, expansion = m.groups()
305 self.argspecs[name] = [parameter]
311 if self.is_internal_name(name):
314 elif (name.startswith('PSA_ERROR_') or name == 'PSA_SUCCESS') \
316 self.statuses.add(name)
317 elif name.startswith('PSA_KEY_TYPE_') and not parameter:
318 self.key_types.add(name)
319 elif name.startswith('PSA_KEY_TYPE_') and parameter == 'curve':
320 self.key_types_from_curve[name] = name[:13] + 'IS_' + name[13:]
321 elif name.startswith('PSA_KEY_TYPE_') and parameter == 'group':
322 self.key_types_from_group[name] = name[:13] + 'IS_' + name[13:]
323 elif name.startswith('PSA_ECC_FAMILY_') and not parameter:
324 self.ecc_curves.add(name)
325 elif name.startswith('PSA_DH_FAMILY_') and not parameter:
326 self.dh_groups.add(name)
327 elif name.startswith('PSA_ALG_') and not parameter:
328 if name in ['PSA_ALG_ECDSA_BASE',
332 self.algorithms.add(name)
333 self.record_algorithm_subtype(name, expansion)
334 elif name.startswith('PSA_ALG_') and parameter == 'hash_alg':
335 self.algorithms_from_hash[name] = self.algorithm_tester(name)
336 elif name.startswith('PSA_KEY_USAGE_') and not parameter:
337 self.key_usage_flags.add(name)
459 # Groups: 1=macro name, 2=type, 3=argument list (optional).
472 # Auxiliary macro whose name doesn't fit the usual patterns for
481 name = m.group(1)
482 self.all_declared.add(name)
483 if re.search(self._excluded_name_re, name) or \
484 name in self._excluded_names or \
485 self.is_internal_name(name):
490 dest.add(name)
492 self.argspecs[name] = self._argument_split(m.group(3))
504 for name in re.findall(self._macro_identifier_re, expr):
505 if name not in self.all_declared:
506 yield name