Lines Matching defs:hash
129 /* perform nsec3 hash. return false on failure */
161 /** hash structure for keeping track of running hashes */
167 /** create secalgo hash with hash type */
199 int secalgo_hash_update(struct secalgo_hash* hash, uint8_t* data, size_t len)
201 return EVP_DigestUpdate(hash->ctx, (unsigned char*)data,
205 int secalgo_hash_final(struct secalgo_hash* hash, uint8_t* result,
208 if(EVP_MD_CTX_size(hash->ctx) > (int)maxlen) {
210 log_err("secalgo_hash_final: hash buffer too small");
213 *resultlen = EVP_MD_CTX_size(hash->ctx);
214 return EVP_DigestFinal_ex(hash->ctx, result, NULL);
217 void secalgo_hash_delete(struct secalgo_hash* hash)
219 if(!hash) return;
220 EVP_MD_CTX_destroy(hash->ctx);
221 free(hash);
225 * Return size of DS digest according to its hash algorithm.
266 /** Perform GOST hash */
526 * hash in EVP. We create one for ecdsa_sha256 */
871 /* perform nsec3 hash. return false on failure */
891 /** the secalgo hash structure */
893 /** hash context */
897 /** create hash struct of type */
921 int secalgo_hash_update(struct secalgo_hash* hash, uint8_t* data, size_t len)
923 HASH_Update(hash->ctx, (unsigned char*)data, (unsigned int)len);
927 int secalgo_hash_final(struct secalgo_hash* hash, uint8_t* result,
931 if(HASH_ResultLenContext(hash->ctx) > (unsigned int)maxlen) {
933 log_err("secalgo_hash_final: hash buffer too small");
936 HASH_End(hash->ctx, (unsigned char*)result, &reslen,
942 void secalgo_hash_delete(struct secalgo_hash* hash)
944 if(!hash) return;
945 HASH_Destroy(hash->ctx);
946 free(hash);
1244 /* hash prefix for md5, RFC2537 */
1247 /* hash prefix to prepend to hash output, from RFC3110 */
1384 unsigned char hash[HASH_LENGTH_MAX];
1389 SECItem sechash = {siBuffer, hash, 0};
1391 unsigned char* prefix = NULL; /* prefix for hash, RFC3110, RFC5702 */
1429 /* hash the data */
1431 if(sechash.len > sizeof(hash)) {
1432 verbose(VERB_QUERY, "verify: hash too large for buffer");
1436 if(HASH_HashBuf(htype, hash, (unsigned char*)sldns_buffer_begin(buf),
1452 memmove(sechash.data+prefixlen, hash, hashlen);
1557 /* perform nsec3 hash. return false on failure */
1577 /** secalgo hash structure */
1607 int secalgo_hash_update(struct secalgo_hash* hash, uint8_t* data, size_t len)
1609 if(hash->active == 384) {
1610 sha384_update(&hash->ctx384, len, data);
1611 } else if(hash->active == 512) {
1612 sha512_update(&hash->ctx512, len, data);
1619 int secalgo_hash_final(struct secalgo_hash* hash, uint8_t* result,
1622 if(hash->active == 384) {
1625 log_err("secalgo_hash_final: hash buffer too small");
1629 sha384_digest(&hash->ctx384, SHA384_DIGEST_SIZE,
1631 } else if(hash->active == 512) {
1634 log_err("secalgo_hash_final: hash buffer too small");
1638 sha512_digest(&hash->ctx512, SHA512_DIGEST_SIZE,
1647 void secalgo_hash_delete(struct secalgo_hash* hash)
1649 if(!hash) return;
1650 free(hash);
1654 * Return size of DS digest according to its hash algorithm.