Lines Matching refs:alg

248             alg: crypto_knowledge.Algorithm,
257 pretty_alg = alg.short_expression()
275 dependencies = psa_information.automatic_dependencies(alg.base_expression, key_type)
286 arguments.append(alg.expression)
297 alg: crypto_knowledge.Algorithm,
301 if alg.can_do(category):
303 for dep in psa_information.automatic_dependencies(alg.base_expression):
304 yield self.make_test_case(alg, category,
309 yield self.make_test_case(alg, category, self.Reason.INVALID)
313 alg: crypto_knowledge.Algorithm,
318 key_is_compatible = kt.can_do(alg)
319 if key_is_compatible and alg.can_do(category):
321 for dep in psa_information.automatic_dependencies(alg.base_expression):
322 yield self.make_test_case(alg, category,
327 yield self.make_test_case(alg, category,
332 yield self.make_test_case(alg, category,
335 elif alg.can_do(category):
337 yield self.make_test_case(alg, category,
348 alg: crypto_knowledge.Algorithm,
356 yield from self.one_key_test_cases(alg, category)
358 yield from self.no_key_test_cases(alg, category)
364 alg = crypto_knowledge.Algorithm(expr)
365 yield from self.test_cases_for_algorithm(alg)
447 alg: psa_storage.Expr
465 m = cls.RSA_OAEP_RE.match(alg.string)
478 if m and alg.string != 'PSA_ALG_ECDSA_ANY':
496 key.alg.string, key.alg2.string,
507 if self.exercise_key_with_algorithm(key.type, key.bits, key.alg):
515 key.alg.string, key.alg2.string,
534 usage=['PSA_KEY_USAGE_EXPORT'], alg=0, alg2=0,
567 usage=usage_flags, alg=0, alg2=0,
599 alg: Optional[crypto_knowledge.Algorithm] = None,
603 If alg is not None, this key allows it.
608 if alg is not None:
609 alg1 = alg.expression
610 usage_flags += alg.usage_flags(public=kt.is_public())
613 if alg is not None:
614 description += ', ' + alg.short_expression(1)
618 usage=usage_flags, alg=alg1, alg2=alg2,
636 compatible_algorithms = [alg for alg in all_algorithms
637 if kt.can_do(alg)]
638 for alg in compatible_algorithms:
639 yield self.key_for_type_and_alg(kt, bits, alg)
644 all_algorithms = [crypto_knowledge.Algorithm(alg)
645 for alg in self.constructors.generate_expressions(
651 def keys_for_algorithm(self, alg: str) -> Iterator[StorageTestData]:
657 descr = crypto_knowledge.short_expression(alg, 1)
662 usage=usage, alg=alg, alg2=0,
664 description='alg: ' + descr)
669 usage=usage, alg=0, alg2=alg,
677 for alg in self.constructors.generate_expressions(algorithms):
678 yield from self.keys_for_algorithm(alg)
722 alg: str,
737 alg_expression = crypto_knowledge.short_expression(alg, 1)
747 alg=alg, alg2=alg2,
770 for alg in algorithms:
772 alg_keywords = set(alg.partition('(')[0].split(sep='_')[2:])
794 if alg in alg_with_keys:
795 alg_with_keys[alg].append(key_type)
797 alg_with_keys[alg] = [key_type]
808 for alg in sorted(alg_with_keys):
809 for key_type in sorted(alg_with_keys[alg]):
815 yield self.keys_for_implicit_usage(usage, alg, kt)