Lines Matching refs:sha2_context
56 SHA2_CTX *sha2_context;
58 if ((sha2_context = malloc(sizeof (SHA2_CTX))) == NULL)
63 SHA2Init(SHA256, sha2_context);
67 SHA2Init(SHA384, sha2_context);
71 SHA2Init(SHA512, sha2_context);
75 return (sha2_context);
82 SHA2_CTX *sha2_context;
84 if ((sha2_context = kmem_zalloc(sizeof (SHA2_CTX),
90 SHA2Init(SHA256, sha2_context);
94 SHA2Init(SHA384, sha2_context);
98 SHA2Init(SHA512, sha2_context);
102 return (sha2_context);
110 * sha2_context: pointer to SHA2 context
120 fips_sha2_hash(SHA2_CTX *sha2_context, uchar_t *in,
127 SHA2Update((SHA2_CTX *)sha2_context, in, inlen);
128 SHA2Final(out, (SHA2_CTX *)sha2_context);
134 if (sha2_context)
136 kmem_free(sha2_context, sizeof (SHA2_CTX));
138 free(sha2_context);
605 SHA2_CTX *sha2_context = NULL;
620 sha2_context = fips_sha2_build_context(SHA256_TYPE);
622 sha2_context = fips_sha2_build_context(CKM_SHA256);
625 if (sha2_context == NULL)
628 rv = fips_sha2_hash(sha2_context,
641 sha2_context = fips_sha2_build_context(SHA384_TYPE);
643 sha2_context = fips_sha2_build_context(CKM_SHA384);
646 if (sha2_context == NULL)
649 rv = fips_sha2_hash(sha2_context,
662 sha2_context = fips_sha2_build_context(SHA512_TYPE);
664 sha2_context = fips_sha2_build_context(CKM_SHA512);
667 if (sha2_context == NULL)
670 rv = fips_sha2_hash(sha2_context,