]>
git.ipfire.org Git - people/ms/u-boot.git/blob - cmd/hash.c
2 * Copyright (c) 2012 The Chromium OS Authors.
5 * Joe Hershberger, National Instruments, joe.hershberger@ni.com
8 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
10 * SPDX-License-Identifier: GPL-2.0+
16 #include <linux/ctype.h>
18 static int do_hash(cmd_tbl_t
*cmdtp
, int flag
, int argc
, char * const argv
[])
21 int flags
= HASH_FLAG_ENV
;
23 #ifdef CONFIG_HASH_VERIFY
26 if (!strcmp(argv
[1], "-v")) {
27 flags
|= HASH_FLAG_VERIFY
;
32 /* Move forward to 'algorithm' parameter */
35 for (s
= *argv
; *s
; s
++)
37 return hash_command(*argv
, flags
, cmdtp
, flag
, argc
- 1, argv
+ 1);
40 #ifdef CONFIG_HASH_VERIFY
47 hash
, HARGS
, 1, do_hash
,
48 "compute hash message digest",
49 "algorithm address count [[*]hash_dest]\n"
50 " - compute message digest [save to env var / *address]"
51 #ifdef CONFIG_HASH_VERIFY
52 "\nhash -v algorithm address count [*]hash\n"
53 " - verify message digest of memory area to immediate value, \n"
54 " env var or *address"