Lines Matching refs:md
67 static int digest_md5_final(EVP_MD_CTX *ctx, unsigned char *md);
73 EVP_MD *md; in digest_md5() local
75 if ((md = EVP_MD_meth_new(NID_md5, NID_md5WithRSAEncryption)) == NULL in digest_md5()
76 || !EVP_MD_meth_set_result_size(md, MD5_DIGEST_LENGTH) in digest_md5()
77 || !EVP_MD_meth_set_input_blocksize(md, MD5_CBLOCK) in digest_md5()
78 || !EVP_MD_meth_set_app_datasize(md, in digest_md5()
80 || !EVP_MD_meth_set_flags(md, 0) in digest_md5()
81 || !EVP_MD_meth_set_init(md, digest_md5_init) in digest_md5()
82 || !EVP_MD_meth_set_update(md, digest_md5_update) in digest_md5()
83 || !EVP_MD_meth_set_final(md, digest_md5_final)) { in digest_md5()
84 EVP_MD_meth_free(md); in digest_md5()
85 md = NULL; in digest_md5()
87 _hidden_md5_md = md; in digest_md5()
96 static int digest_sha1_final(EVP_MD_CTX *ctx, unsigned char *md);
102 EVP_MD *md; in digest_sha1() local
104 if ((md = EVP_MD_meth_new(NID_sha1, NID_sha1WithRSAEncryption)) == NULL in digest_sha1()
105 || !EVP_MD_meth_set_result_size(md, SHA_DIGEST_LENGTH) in digest_sha1()
106 || !EVP_MD_meth_set_input_blocksize(md, SHA_CBLOCK) in digest_sha1()
107 || !EVP_MD_meth_set_app_datasize(md, in digest_sha1()
109 || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_DIGALGID_ABSENT) in digest_sha1()
110 || !EVP_MD_meth_set_init(md, digest_sha1_init) in digest_sha1()
111 || !EVP_MD_meth_set_update(md, digest_sha1_update) in digest_sha1()
112 || !EVP_MD_meth_set_final(md, digest_sha1_final)) { in digest_sha1()
113 EVP_MD_meth_free(md); in digest_sha1()
114 md = NULL; in digest_sha1()
116 _hidden_sha1_md = md; in digest_sha1()
125 static int digest_sha256_final(EVP_MD_CTX *ctx, unsigned char *md);
131 EVP_MD *md; in digest_sha256() local
133 if ((md = EVP_MD_meth_new(NID_sha256, NID_sha256WithRSAEncryption)) == NULL in digest_sha256()
134 || !EVP_MD_meth_set_result_size(md, SHA256_DIGEST_LENGTH) in digest_sha256()
135 || !EVP_MD_meth_set_input_blocksize(md, SHA256_CBLOCK) in digest_sha256()
136 || !EVP_MD_meth_set_app_datasize(md, in digest_sha256()
138 || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_DIGALGID_ABSENT) in digest_sha256()
139 || !EVP_MD_meth_set_init(md, digest_sha256_init) in digest_sha256()
140 || !EVP_MD_meth_set_update(md, digest_sha256_update) in digest_sha256()
141 || !EVP_MD_meth_set_final(md, digest_sha256_final)) { in digest_sha256()
142 EVP_MD_meth_free(md); in digest_sha256()
143 md = NULL; in digest_sha256()
145 _hidden_sha256_md = md; in digest_sha256()
154 static int digest_sha384_final(EVP_MD_CTX *ctx, unsigned char *md);
159 static int digest_sha512_final(EVP_MD_CTX *ctx, unsigned char *md);
165 EVP_MD *md; in digest_sha384() local
167 if ((md = EVP_MD_meth_new(NID_sha384, NID_sha384WithRSAEncryption)) == NULL in digest_sha384()
168 || !EVP_MD_meth_set_result_size(md, SHA384_DIGEST_LENGTH) in digest_sha384()
169 || !EVP_MD_meth_set_input_blocksize(md, SHA512_CBLOCK) in digest_sha384()
170 || !EVP_MD_meth_set_app_datasize(md, in digest_sha384()
172 || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_DIGALGID_ABSENT) in digest_sha384()
173 || !EVP_MD_meth_set_init(md, digest_sha384_init) in digest_sha384()
174 || !EVP_MD_meth_set_update(md, digest_sha384_update) in digest_sha384()
175 || !EVP_MD_meth_set_final(md, digest_sha384_final)) { in digest_sha384()
176 EVP_MD_meth_free(md); in digest_sha384()
177 md = NULL; in digest_sha384()
179 _hidden_sha384_md = md; in digest_sha384()
187 EVP_MD *md; in digest_sha512() local
189 if ((md = EVP_MD_meth_new(NID_sha512, NID_sha512WithRSAEncryption)) == NULL in digest_sha512()
190 || !EVP_MD_meth_set_result_size(md, SHA512_DIGEST_LENGTH) in digest_sha512()
191 || !EVP_MD_meth_set_input_blocksize(md, SHA512_CBLOCK) in digest_sha512()
192 || !EVP_MD_meth_set_app_datasize(md, in digest_sha512()
194 || !EVP_MD_meth_set_flags(md, EVP_MD_FLAG_DIGALGID_ABSENT) in digest_sha512()
195 || !EVP_MD_meth_set_init(md, digest_sha512_init) in digest_sha512()
196 || !EVP_MD_meth_set_update(md, digest_sha512_update) in digest_sha512()
197 || !EVP_MD_meth_set_final(md, digest_sha512_final)) { in digest_sha512()
198 EVP_MD_meth_free(md); in digest_sha512()
199 md = NULL; in digest_sha512()
201 _hidden_sha512_md = md; in digest_sha512()
225 const EVP_MD *md; in ossltest_digest_nids() local
226 if ((md = digest_md5()) != NULL) in ossltest_digest_nids()
227 digest_nids[pos++] = EVP_MD_get_type(md); in ossltest_digest_nids()
228 if ((md = digest_sha1()) != NULL) in ossltest_digest_nids()
229 digest_nids[pos++] = EVP_MD_get_type(md); in ossltest_digest_nids()
230 if ((md = digest_sha256()) != NULL) in ossltest_digest_nids()
231 digest_nids[pos++] = EVP_MD_get_type(md); in ossltest_digest_nids()
232 if ((md = digest_sha384()) != NULL) in ossltest_digest_nids()
233 digest_nids[pos++] = EVP_MD_get_type(md); in ossltest_digest_nids()
234 if ((md = digest_sha512()) != NULL) in ossltest_digest_nids()
235 digest_nids[pos++] = EVP_MD_get_type(md); in ossltest_digest_nids()
554 static void fill_known_data(unsigned char *md, unsigned int len) in fill_known_data() argument
559 md[i] = (unsigned char)(i & 0xff); in fill_known_data()
580 static int digest_md5_final(EVP_MD_CTX *ctx, unsigned char *md) in digest_md5_final() argument
582 int ret = EVP_MD_meth_get_final(EVP_md5())(ctx, md); in digest_md5_final()
585 fill_known_data(md, MD5_DIGEST_LENGTH); in digest_md5_final()
604 static int digest_sha1_final(EVP_MD_CTX *ctx, unsigned char *md) in digest_sha1_final() argument
606 int ret = EVP_MD_meth_get_final(EVP_sha1())(ctx, md); in digest_sha1_final()
609 fill_known_data(md, SHA_DIGEST_LENGTH); in digest_sha1_final()
628 static int digest_sha256_final(EVP_MD_CTX *ctx, unsigned char *md) in digest_sha256_final() argument
630 int ret = EVP_MD_meth_get_final(EVP_sha256())(ctx, md); in digest_sha256_final()
633 fill_known_data(md, SHA256_DIGEST_LENGTH); in digest_sha256_final()
652 static int digest_sha384_final(EVP_MD_CTX *ctx, unsigned char *md) in digest_sha384_final() argument
654 int ret = EVP_MD_meth_get_final(EVP_sha384())(ctx, md); in digest_sha384_final()
657 fill_known_data(md, SHA384_DIGEST_LENGTH); in digest_sha384_final()
676 static int digest_sha512_final(EVP_MD_CTX *ctx, unsigned char *md) in digest_sha512_final() argument
678 int ret = EVP_MD_meth_get_final(EVP_sha512())(ctx, md); in digest_sha512_final()
681 fill_known_data(md, SHA512_DIGEST_LENGTH); in digest_sha512_final()