Lines Matching refs:algo
34 static int hash_init_sha1(struct hash_algo *algo, void **ctxp) in hash_init_sha1() argument
42 static int hash_update_sha1(struct hash_algo *algo, void *ctx, const void *buf, in hash_update_sha1() argument
49 static int hash_finish_sha1(struct hash_algo *algo, void *ctx, void *dest_buf, in hash_finish_sha1() argument
52 if (size < algo->digest_size) in hash_finish_sha1()
62 static int hash_init_sha256(struct hash_algo *algo, void **ctxp) in hash_init_sha256() argument
70 static int hash_update_sha256(struct hash_algo *algo, void *ctx, in hash_update_sha256() argument
77 static int hash_finish_sha256(struct hash_algo *algo, void *ctx, void in hash_finish_sha256() argument
80 if (size < algo->digest_size) in hash_finish_sha256()
89 static int hash_init_crc32(struct hash_algo *algo, void **ctxp) in hash_init_crc32() argument
97 static int hash_update_crc32(struct hash_algo *algo, void *ctx, in hash_update_crc32() argument
104 static int hash_finish_crc32(struct hash_algo *algo, void *ctx, void *dest_buf, in hash_finish_crc32() argument
107 if (size < algo->digest_size) in hash_finish_crc32()
218 struct hash_algo *algo; in hash_parse_string() local
222 ret = hash_lookup_algo(algo_name, &algo); in hash_parse_string()
226 for (i = 0; i < algo->digest_size; i++) { in hash_parse_string()
239 struct hash_algo *algo; in hash_block() local
242 ret = hash_lookup_algo(algo_name, &algo); in hash_block()
246 if (output_size && *output_size < algo->digest_size) { in hash_block()
248 *output_size, algo->digest_size); in hash_block()
252 *output_size = algo->digest_size; in hash_block()
253 algo->hash_func_ws(data, len, output, algo->chunk_size); in hash_block()
270 static void store_result(struct hash_algo *algo, const uint8_t *sum, in store_result() argument
293 for (i = 0; i < algo->digest_size; i++) { in store_result()
304 buf = map_sysmem(addr, algo->digest_size); in store_result()
305 memcpy(buf, sum, algo->digest_size); in store_result()
326 static int parse_verify_sum(struct hash_algo *algo, char *verify_str, in parse_verify_sum() argument
344 buf = map_sysmem(addr, algo->digest_size); in parse_verify_sum()
345 memcpy(vsum, buf, algo->digest_size); in parse_verify_sum()
348 int digits = algo->digest_size * 2; in parse_verify_sum()
366 hash_parse_string(algo->name, vsum_str, vsum); in parse_verify_sum()
371 static void hash_show(struct hash_algo *algo, ulong addr, ulong len, uint8_t *output) in hash_show() argument
375 printf("%s for %08lx ... %08lx ==> ", algo->name, addr, addr + len - 1); in hash_show()
376 for (i = 0; i < algo->digest_size; i++) in hash_show()
392 struct hash_algo *algo; local
397 if (hash_lookup_algo(algo_name, &algo)) {
403 if (algo->digest_size > HASH_MAX_DIGEST_SIZE) {
409 algo->hash_func_ws(buf, len, output, algo->chunk_size);
419 if (parse_verify_sum(algo, *argv, vsum,
422 "%s sum\n", *argv, algo->name);
425 if (memcmp(output, vsum, algo->digest_size) != 0) {
428 hash_show(algo, addr, len, output);
430 for (i = 0; i < algo->digest_size; i++)
436 hash_show(algo, addr, len, output);
440 store_result(algo, output, *argv,