]> Git Repo - J-u-boot.git/blob - cmd/sha1sum.c
video: Allow querying the font size
[J-u-boot.git] / cmd / sha1sum.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2011
4  * Joe Hershberger, National Instruments, [email protected]
5  *
6  * (C) Copyright 2000
7  * Wolfgang Denk, DENX Software Engineering, [email protected].
8  */
9
10 #include <command.h>
11 #include <hash.h>
12 #include <u-boot/sha1.h>
13
14 int do_sha1sum(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
15 {
16         int flags = HASH_FLAG_ENV;
17         int ac;
18         char * const *av;
19
20         if (argc < 3)
21                 return CMD_RET_USAGE;
22
23         av = argv + 1;
24         ac = argc - 1;
25 #ifdef CONFIG_SHA1SUM_VERIFY
26         if (strcmp(*av, "-v") == 0) {
27                 flags |= HASH_FLAG_VERIFY;
28                 av++;
29                 ac--;
30         }
31 #endif
32
33         return hash_command("sha1", flags, cmdtp, flag, ac, av);
34 }
35
36 #ifdef CONFIG_SHA1SUM_VERIFY
37 U_BOOT_CMD(
38         sha1sum,        5,      1,      do_sha1sum,
39         "compute SHA1 message digest",
40         "address count [[*]sum]\n"
41                 "    - compute SHA1 message digest [save to sum]\n"
42         "sha1sum -v address count [*]sum\n"
43                 "    - verify sha1sum of memory area"
44 );
45 #else
46 U_BOOT_CMD(
47         sha1sum,        4,      1,      do_sha1sum,
48         "compute SHA1 message digest",
49         "address count [[*]sum]\n"
50                 "    - compute SHA1 message digest [save to sum]"
51 );
52 #endif
This page took 0.027026 seconds and 4 git commands to generate.