MCPcopy Create free account
hub / github.com/F-Stack/f-stack / crypto_auth_hash

Function crypto_auth_hash

freebsd/opencrypto/crypto.c:522–582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520}
521
522struct auth_hash *
523crypto_auth_hash(const struct crypto_session_params *csp)
524{
525
526 switch (csp->csp_auth_alg) {
527 case CRYPTO_SHA1_HMAC:
528 return (&auth_hash_hmac_sha1);
529 case CRYPTO_SHA2_224_HMAC:
530 return (&auth_hash_hmac_sha2_224);
531 case CRYPTO_SHA2_256_HMAC:
532 return (&auth_hash_hmac_sha2_256);
533 case CRYPTO_SHA2_384_HMAC:
534 return (&auth_hash_hmac_sha2_384);
535 case CRYPTO_SHA2_512_HMAC:
536 return (&auth_hash_hmac_sha2_512);
537 case CRYPTO_NULL_HMAC:
538 return (&auth_hash_null);
539 case CRYPTO_RIPEMD160_HMAC:
540 return (&auth_hash_hmac_ripemd_160);
541 case CRYPTO_SHA1:
542 return (&auth_hash_sha1);
543 case CRYPTO_SHA2_224:
544 return (&auth_hash_sha2_224);
545 case CRYPTO_SHA2_256:
546 return (&auth_hash_sha2_256);
547 case CRYPTO_SHA2_384:
548 return (&auth_hash_sha2_384);
549 case CRYPTO_SHA2_512:
550 return (&auth_hash_sha2_512);
551 case CRYPTO_AES_NIST_GMAC:
552 switch (csp->csp_auth_klen) {
553 case 128 / 8:
554 return (&auth_hash_nist_gmac_aes_128);
555 case 192 / 8:
556 return (&auth_hash_nist_gmac_aes_192);
557 case 256 / 8:
558 return (&auth_hash_nist_gmac_aes_256);
559 default:
560 return (NULL);
561 }
562 case CRYPTO_BLAKE2B:
563 return (&auth_hash_blake2b);
564 case CRYPTO_BLAKE2S:
565 return (&auth_hash_blake2s);
566 case CRYPTO_POLY1305:
567 return (&auth_hash_poly1305);
568 case CRYPTO_AES_CCM_CBC_MAC:
569 switch (csp->csp_auth_klen) {
570 case 128 / 8:
571 return (&auth_hash_ccm_cbc_mac_128);
572 case 192 / 8:
573 return (&auth_hash_ccm_cbc_mac_192);
574 case 256 / 8:
575 return (&auth_hash_ccm_cbc_mac_256);
576 default:
577 return (NULL);
578 }
579 default:

Callers 4

xlp_sec_newsessionFunction · 0.85
swcr_setup_authFunction · 0.85
swcr_auth_supportedFunction · 0.85
check_cspFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected