Lines Matching refs:hash

79         const gcry_md_spec_t *hash;
127 struct xz_dec_hash hash;
146 * Hash calculated from the Records (matches block.hash in
149 struct xz_dec_hash hash;
237 * the sizes possibly stored in the Block Header. Update the hash and
267 if (s->hash)
268 s->hash->write(s->hash_context,b->out + s->out_start,
286 s->block.hash.unpadded += s->block_header.size
288 s->block.hash.unpadded += s->hash_size;
290 s->block.hash.uncompressed += s->block.uncompressed;
293 if (s->hash)
294 s->hash->write(s->block.hash.hash_context,
295 (const uint8_t *)&s->block.hash,
311 if (s->hash)
312 s->hash->write(s->hash_context,b->in + s->in_start, in_used);
353 s->index.hash.unpadded += s->vli;
358 s->index.hash.uncompressed += s->vli;
361 if (s->hash)
362 s->hash->write(s->index.hash.hash_context,
363 (const uint8_t *)&s->index.hash, 2 * sizeof(vli_type));
383 const gcry_md_spec_t *hash = crc32 ? s->crc32 : s->hash;
386 if(!s->have_hash_value && hash
387 && sizeof (s->hash_value) >= hash->mdlen)
389 hash->final(hash_context);
390 grub_memcpy (s->hash_value, hash->read(hash_context),
391 hash->mdlen);
411 if (hash && s->hash_value[s->pos / 8] != b->in[b->in_pos++])
420 if (s->hash)
421 s->hash->init(s->hash_context);
498 s->hash = grub_crypto_lookup_md_by_name (hashes[s->temp.buf[HEADER_MAGIC_SIZE + 1]].name);
499 if (s->hash)
501 if (s->hash->mdlen != s->hash_size)
503 s->hash_context = kmalloc(s->hash->contextsize, GFP_KERNEL);
510 s->index.hash.hash_context = kmalloc(s->hash->contextsize,
512 if (s->index.hash.hash_context == NULL)
519 s->block.hash.hash_context = kmalloc(s->hash->contextsize, GFP_KERNEL);
520 if (s->block.hash.hash_context == NULL)
522 kfree(s->index.hash.hash_context);
528 s->hash->init(s->hash_context);
529 s->hash->init(s->index.hash.hash_context);
530 s->hash->init(s->block.hash.hash_context);
532 if (!s->hash)
539 s->hash = 0;
843 if (s->hash)
845 uint8_t block_hash[s->hash->mdlen];
846 uint8_t index_hash[s->hash->mdlen];
848 s->hash->final(s->block.hash.hash_context);
849 s->hash->final(s->index.hash.hash_context);
851 s->hash->read(s->block.hash.hash_context),
852 s->hash->mdlen);
854 s->hash->read(s->index.hash.hash_context),
855 s->hash->mdlen);
857 if (s->block.hash.unpadded != s->index.hash.unpadded
858 || s->block.hash.uncompressed != s->index.hash.uncompressed
859 || grub_memcmp (block_hash, index_hash, s->hash->mdlen) != 0)
998 t = s->block.hash.hash_context;
1002 s->block.hash.hash_context = t;
1003 t = s->index.hash.hash_context;
1007 s->index.hash.hash_context = t;
1014 if (s->hash)
1016 s->hash->init(s->hash_context);
1017 s->hash->init(s->index.hash.hash_context);
1018 s->hash->init(s->block.hash.hash_context);
1029 kfree(s->index.hash.hash_context);
1030 kfree(s->block.hash.hash_context);