Lines Matching defs:hash
990 /* Just make sure this hash is supported in this build. */
1012 * Get hash identifier of mbedtls_md_type_t type
1686 * \param hash the input hash
1687 * \param hlen length of the input hash
1693 static int hash_mprime(const unsigned char *hash, size_t hlen,
1717 if ((ret = mbedtls_md_update(&md_ctx, hash, hlen)) != 0) {
1734 * Compute a hash.
1737 * \param input input message to hash
2116 const unsigned char *hash,
2128 if ((md_alg != MBEDTLS_MD_NONE || hashlen != 0) && hash == NULL) {
2139 /* Gather length of hash to sign */
2160 /* Calculate the largest possible salt length, up to the hash size.
2161 * Normally this is the hash length, which is the maximum salt length
2164 * that the hash length plus the salt length plus 2 bytes must be at most
2197 ret = hash_mprime(hash, hashlen, salt, slen, p, (mbedtls_md_type_t)ctx->hash_id);
2228 const unsigned char *hash,
2238 return rsa_rsassa_pss_sign_no_mode_check(ctx, f_rng, p_rng, md_alg, hashlen, hash, saltlen,
2247 const unsigned char *hash,
2251 hashlen, hash, MBEDTLS_RSA_SALT_LEN_ANY, sig);
2263 const unsigned char *hash,
2268 hashlen, hash, saltlen, sig);
2279 const unsigned char *hash,
2283 hashlen, hash, MBEDTLS_RSA_SALT_LEN_ANY, sig);
2297 * - md_alg: Identifies the hash algorithm used to generate the given hash;
2299 * - hashlen: Length of hash. Must match md_alg if that's not NONE.
2300 * - hash: Buffer containing the hashed message or the raw data.
2305 * - hash has size hashlen.
2311 const unsigned char *hash,
2348 * - Need hashlen bytes for hash
2349 * - Need oid_size bytes for hash alg OID.
2382 memcpy(p, hash, hashlen);
2411 memcpy(p, hash, hashlen);
2432 const unsigned char *hash,
2438 if ((md_alg != MBEDTLS_MD_NONE || hashlen != 0) && hash == NULL) {
2447 * Prepare PKCS1-v1.5 encoding (padding and hash identifier)
2450 if ((ret = rsa_rsassa_pkcs1_v15_encode(md_alg, hashlen, hash,
2501 const unsigned char *hash,
2504 if ((md_alg != MBEDTLS_MD_NONE || hashlen != 0) && hash == NULL) {
2512 md_alg, hashlen, hash, sig);
2518 hashlen, hash, sig);
2533 const unsigned char *hash,
2547 if ((md_alg != MBEDTLS_MD_NONE || hashlen != 0) && hash == NULL) {
2570 /* Gather length of hash to sign */
2631 ret = hash_mprime(hash, hashlen, p, observed_salt_len,
2650 const unsigned char *hash,
2654 if ((md_alg != MBEDTLS_MD_NONE || hashlen != 0) && hash == NULL) {
2663 md_alg, hashlen, hash,
2678 const unsigned char *hash,
2685 if ((md_alg != MBEDTLS_MD_NONE || hashlen != 0) && hash == NULL) {
2692 * Prepare expected PKCS1 v1.5 encoding of hash.
2701 if ((ret = rsa_rsassa_pkcs1_v15_encode(md_alg, hashlen, hash, sig_len,
2707 * Apply RSA primitive to get what should be PKCS1 encoded hash.
2745 const unsigned char *hash,
2748 if ((md_alg != MBEDTLS_MD_NONE || hashlen != 0) && hash == NULL) {
2756 hashlen, hash, sig);
2762 hashlen, hash, sig);