Home | History | Annotate | Download | only in isc

Lines Matching refs:md

1 /*	$NetBSD: md.c,v 1.1 2024/02/18 20:57:49 christos Exp $	*/
22 #include <isc/md.h>
29 isc_md_t *md = EVP_MD_CTX_new();
30 RUNTIME_CHECK(md != NULL);
31 return (md);
35 isc_md_free(isc_md_t *md) {
36 if (ISC_UNLIKELY(md == NULL)) {
40 EVP_MD_CTX_free(md);
44 isc_md_init(isc_md_t *md, const isc_md_type_t *md_type) {
45 REQUIRE(md != NULL);
51 if (EVP_DigestInit_ex(md, md_type, NULL) != 1) {
59 isc_md_reset(isc_md_t *md) {
60 REQUIRE(md != NULL);
62 if (EVP_MD_CTX_reset(md) != 1) {
70 isc_md_update(isc_md_t *md, const unsigned char *buf, const size_t len) {
71 REQUIRE(md != NULL);
77 if (EVP_DigestUpdate(md, buf, len) != 1) {
85 isc_md_final(isc_md_t *md, unsigned char *digest, unsigned int *digestlen) {
86 REQUIRE(md != NULL);
89 if (EVP_DigestFinal_ex(md, digest, digestlen) != 1) {
97 isc_md_get_md_type(isc_md_t *md) {
98 REQUIRE(md != NULL);
100 return (EVP_MD_CTX_md(md));
104 isc_md_get_size(isc_md_t *md) {
105 REQUIRE(md != NULL);
107 return (EVP_MD_CTX_size(md));
111 isc_md_get_block_size(isc_md_t *md) {
112 REQUIRE(md != NULL);
114 return (EVP_MD_CTX_block_size(md));
144 isc_md_t *md;
147 md = isc_md_new();
149 res = isc_md_init(md, md_type);
154 res = isc_md_update(md, buf, len);
159 res = isc_md_final(md, digest, digestlen);
164 isc_md_free(md);