Lines Matching refs:hash

32   {"hash", 'h', 0, N_("Specify hash to use."), N_("HASH"), ARG_TYPE_STRING},
33 {"check", 'c', 0, N_("Check hash list file."), N_("FILE"), ARG_TYPE_STRING},
34 {"prefix", 'p', 0, N_("Base directory for hash list."), N_("DIRECTORY"),
63 hash_file (grub_file_t file, const gcry_md_spec_t *hash, void *result)
65 grub_uint8_t context[hash->contextsize];
69 hash->init (context);
78 hash->write (context, readbuf, r);
80 hash->final (context);
81 grub_memcpy (result, hash->read (context), hash->mdlen);
87 check_list (const gcry_md_spec_t *hash, const char *hashfilename,
92 grub_uint8_t expected[hash->mdlen];
93 grub_uint8_t actual[hash->mdlen];
105 for (i = 0; i < hash->mdlen; i++)
111 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid hash list");
115 return grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid hash list");
140 err = hash_file (file, hash, actual);
156 if (grub_crypto_memcmp (expected, actual, hash->mdlen) != 0)
164 "hash of '%s' mismatches", p);
173 "%d files couldn't be read and hash "
185 const gcry_md_spec_t *hash;
198 return grub_error (GRUB_ERR_BAD_ARGUMENT, "no hash specified");
200 hash = grub_crypto_lookup_md_by_name (hashname);
201 if (!hash)
202 return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown hash");
212 return check_list (hash, state[1].arg, prefix, keep, uncompress);
217 grub_uint8_t result[hash->mdlen];
233 err = hash_file (file, hash, result);
244 for (j = 0; j < hash->mdlen; j++)
262 N_("Compute or check hash checksum."),
267 N_("Compute or check hash checksum."),
272 N_("Compute or check hash checksum."),
277 N_("Compute or check hash checksum."),
282 N_("Compute or check hash checksum."),
288 N_("Compute or check hash checksum."),