X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fhash.h;h=97bb3ed5d9ac0b74704e841a1750b8c687e85471;hb=2493ce6258a59881b702cbe255db9e53f1e3fd13;hp=d81433772fc83e444a91111bf2ec9dd313dddaf6;hpb=20d08f59fa7cdde0da1eb7aca7915c91dbdeaf51;p=platform%2Fkernel%2Fu-boot.git diff --git a/include/hash.h b/include/hash.h index d814337..97bb3ed 100644 --- a/include/hash.h +++ b/include/hash.h @@ -1,26 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Copyright (c) 2012 The Chromium OS Authors. - * SPDX-License-Identifier: GPL-2.0+ */ #ifndef _HASH_H #define _HASH_H +struct cmd_tbl; + /* * Maximum digest size for all algorithms we support. Having this value * avoids a malloc() or C99 local declaration in common/cmd_hash.c. */ +#if defined(CONFIG_SHA384) || defined(CONFIG_SHA512) +#define HASH_MAX_DIGEST_SIZE 64 +#else #define HASH_MAX_DIGEST_SIZE 32 +#endif enum { HASH_FLAG_VERIFY = 1 << 0, /* Enable verify mode */ HASH_FLAG_ENV = 1 << 1, /* Allow env vars */ }; -#if defined(CONFIG_SHA1SUM_VERIFY) || defined(CONFIG_CRC32_VERIFY) -#define CONFIG_HASH_VERIFY -#endif - struct hash_algo { const char *name; /* Name of algorithm */ int digest_size; /* Length of digest */ @@ -89,8 +91,8 @@ struct hash_algo { * @argc: Number of arguments (arg 0 must be the command text) * @argv: Arguments */ -int hash_command(const char *algo_name, int flags, cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]); +int hash_command(const char *algo_name, int flags, struct cmd_tbl *cmdtp, + int flag, int argc, char *const argv[]); /** * hash_block() - Hash a block according to the requested algorithm