Lines Matching refs:mdlen
285 unsigned mdlen;
289 mdlen = EVP_MD_size(dgst);
302 if (outlen + mdlen <= len) {
306 outlen += mdlen;
326 unsigned i, emlen, mdlen;
338 mdlen = EVP_MD_size(md);
340 if (to_len < 2 * mdlen + 2) {
346 if (from_len > emlen - 2 * mdlen - 1) {
351 if (emlen < 2 * mdlen + 1) {
358 db = to + mdlen + 1;
363 memset(db + mdlen, 0, emlen - from_len - 2 * mdlen - 1);
364 db[emlen - from_len - mdlen - 1] = 0x01;
365 memcpy(db + emlen - from_len - mdlen, from, from_len);
366 if (!RAND_bytes(seed, mdlen)) {
370 dbmask = OPENSSL_malloc(emlen - mdlen);
376 if (PKCS1_MGF1(dbmask, emlen - mdlen, seed, mdlen, mgf1md) < 0) {
379 for (i = 0; i < emlen - mdlen; i++) {
383 if (PKCS1_MGF1(seedmask, mdlen, db, emlen - mdlen, mgf1md) < 0) {
386 for (i = 0; i < mdlen; i++) {
400 unsigned i, dblen, mlen = -1, mdlen, bad, looking_for_one_byte, one_index = 0;
411 mdlen = EVP_MD_size(md);
416 if (from_len < 1 + 2*mdlen + 1) {
422 dblen = from_len - mdlen - 1;
430 maskeddb = from + 1 + mdlen;
432 if (PKCS1_MGF1(seed, mdlen, maskeddb, dblen, mgf1md)) {
435 for (i = 0; i < mdlen; i++) {
439 if (PKCS1_MGF1(db, dblen, seed, mdlen, mgf1md)) {
450 bad = ~constant_time_is_zero(CRYPTO_memcmp(db, phash, mdlen));
454 for (i = mdlen; i < dblen; i++) {