Lines Matching refs:algo
33 static int hash_init_sha1(struct hash_algo *algo, void **ctxp) in hash_init_sha1() argument
41 static int hash_update_sha1(struct hash_algo *algo, void *ctx, const void *buf, in hash_update_sha1() argument
48 static int hash_finish_sha1(struct hash_algo *algo, void *ctx, void *dest_buf, in hash_finish_sha1() argument
51 if (size < algo->digest_size) in hash_finish_sha1()
61 static int hash_init_sha256(struct hash_algo *algo, void **ctxp) in hash_init_sha256() argument
69 static int hash_update_sha256(struct hash_algo *algo, void *ctx, in hash_update_sha256() argument
76 static int hash_finish_sha256(struct hash_algo *algo, void *ctx, void in hash_finish_sha256() argument
79 if (size < algo->digest_size) in hash_finish_sha256()
88 static int hash_init_crc32(struct hash_algo *algo, void **ctxp) in hash_init_crc32() argument
96 static int hash_update_crc32(struct hash_algo *algo, void *ctx, in hash_update_crc32() argument
103 static int hash_finish_crc32(struct hash_algo *algo, void *ctx, void *dest_buf, in hash_finish_crc32() argument
106 if (size < algo->digest_size) in hash_finish_crc32()
217 struct hash_algo *algo; in hash_parse_string() local
221 ret = hash_lookup_algo(algo_name, &algo); in hash_parse_string()
225 for (i = 0; i < algo->digest_size; i++) { in hash_parse_string()
238 struct hash_algo *algo; in hash_block() local
241 ret = hash_lookup_algo(algo_name, &algo); in hash_block()
245 if (output_size && *output_size < algo->digest_size) { in hash_block()
247 *output_size, algo->digest_size); in hash_block()
251 *output_size = algo->digest_size; in hash_block()
252 algo->hash_func_ws(data, len, output, algo->chunk_size); in hash_block()
269 static void store_result(struct hash_algo *algo, const uint8_t *sum, in store_result() argument
292 for (i = 0; i < algo->digest_size; i++) { in store_result()
303 buf = map_sysmem(addr, algo->digest_size); in store_result()
304 memcpy(buf, sum, algo->digest_size); in store_result()
325 static int parse_verify_sum(struct hash_algo *algo, char *verify_str, in parse_verify_sum() argument
343 buf = map_sysmem(addr, algo->digest_size); in parse_verify_sum()
344 memcpy(vsum, buf, algo->digest_size); in parse_verify_sum()
347 int digits = algo->digest_size * 2; in parse_verify_sum()
365 hash_parse_string(algo->name, vsum_str, vsum); in parse_verify_sum()
370 static void hash_show(struct hash_algo *algo, ulong addr, ulong len, uint8_t *output) in hash_show() argument
374 printf("%s for %08lx ... %08lx ==> ", algo->name, addr, addr + len - 1); in hash_show()
375 for (i = 0; i < algo->digest_size; i++) in hash_show()
391 struct hash_algo *algo; local
396 if (hash_lookup_algo(algo_name, &algo)) {
402 if (algo->digest_size > HASH_MAX_DIGEST_SIZE) {
411 algo->hash_func_ws(buf, len, output, algo->chunk_size);
421 if (parse_verify_sum(algo, *argv, vsum,
424 "%s sum\n", *argv, algo->name);
427 if (memcmp(output, vsum, algo->digest_size) != 0) {
430 hash_show(algo, addr, len, output);
432 for (i = 0; i < algo->digest_size; i++)
438 hash_show(algo, addr, len, output);
442 store_result(algo, output, *argv,