Lines Matching refs:head
109 self.head = re.sub(r'_(?:PUBLIC_KEY|KEY_PAIR)\Z', r'', m.group(1))
214 if self.head == 'HMAC' and alg.head == 'HMAC':
216 if self.head == 'DES':
218 return alg.head in [
222 if self.head in BLOCK_CIPHERS and \
223 alg.head in frozenset.union(BLOCK_MAC_MODES,
226 if alg.head in ['CMAC', 'OFB'] and \
227 self.head in ['ARIA', 'CAMELLIA']:
230 if self.head == 'CHACHA20' and alg.head == 'CHACHA20_POLY1305':
232 if self.head in {'ARC4', 'CHACHA20'} and \
233 alg.head == 'STREAM_CIPHER':
235 if self.head == 'RSA' and alg.head.startswith('RSA_'):
246 if self.head == 'ECC':
249 if alg.head == 'ECDH' and \
253 if alg.head == 'ECDSA' and \
256 if alg.head in {'PURE_EDDSA', 'EDDSA_PREHASH'} and \
259 if self.head == 'DH' and alg.head == 'FFDH':
318 """Return the head of an algorithm expression.
320 The head is the first (outermost) constructor, without its PSA_ALG_
326 head = m.group(1)
327 if head == 'KEY_AGREEMENT':
331 head = m.group(1)
332 head = re.sub(r'_ANY\Z', r'', head)
333 if re.match(r'ED[0-9]+PH\Z', head):
334 head = 'EDDSA_PREHASH'
335 return head
372 def determine_category(self, expr: str, head: str) -> AlgorithmCategory:
377 prefix = head
410 self.head = self.determine_head(self.base_expression)
411 self.category = self.determine_category(self.base_expression, self.head)