lib: Rename rsa-checksum.c to hash-checksum.c
rsa-checksum.c sontains the hash_calculate() implementations. Despite the "rsa-" file prefix, this function is useful for other algorithms. To prevent confusion, move this file to lib/, and rename it to hash-checksum.c, to give it a more "generic" feel. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
3505fa5727
commit
0bcb28dfb9
@ -16,7 +16,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
|||||||
#include <fdt_region.h>
|
#include <fdt_region.h>
|
||||||
#include <image.h>
|
#include <image.h>
|
||||||
#include <u-boot/rsa.h>
|
#include <u-boot/rsa.h>
|
||||||
#include <u-boot/rsa-checksum.h>
|
#include <u-boot/hash-checksum.h>
|
||||||
|
|
||||||
#define IMAGE_MAX_HASHED_NODES 100
|
#define IMAGE_MAX_HASHED_NODES 100
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ DECLARE_GLOBAL_DATA_PTR;
|
|||||||
#endif /* !USE_HOSTCC*/
|
#endif /* !USE_HOSTCC*/
|
||||||
#include <image.h>
|
#include <image.h>
|
||||||
#include <u-boot/rsa.h>
|
#include <u-boot/rsa.h>
|
||||||
#include <u-boot/rsa-checksum.h>
|
#include <u-boot/hash-checksum.h>
|
||||||
|
|
||||||
#define IMAGE_MAX_HASHED_NODES 100
|
#define IMAGE_MAX_HASHED_NODES 100
|
||||||
|
|
||||||
|
@ -1283,7 +1283,7 @@ struct image_region {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if IMAGE_ENABLE_VERIFY
|
#if IMAGE_ENABLE_VERIFY
|
||||||
# include <u-boot/rsa-checksum.h>
|
# include <u-boot/hash-checksum.h>
|
||||||
#endif
|
#endif
|
||||||
struct checksum_algo {
|
struct checksum_algo {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
@ -61,6 +61,7 @@ endif
|
|||||||
obj-$(CONFIG_$(SPL_)ACPIGEN) += acpi/
|
obj-$(CONFIG_$(SPL_)ACPIGEN) += acpi/
|
||||||
obj-$(CONFIG_$(SPL_)MD5) += md5.o
|
obj-$(CONFIG_$(SPL_)MD5) += md5.o
|
||||||
obj-$(CONFIG_$(SPL_)RSA) += rsa/
|
obj-$(CONFIG_$(SPL_)RSA) += rsa/
|
||||||
|
obj-$(CONFIG_FIT_SIGNATURE) += hash-checksum.o
|
||||||
obj-$(CONFIG_SHA1) += sha1.o
|
obj-$(CONFIG_SHA1) += sha1.o
|
||||||
obj-$(CONFIG_SHA256) += sha256.o
|
obj-$(CONFIG_SHA256) += sha256.o
|
||||||
obj-$(CONFIG_SHA512_ALGO) += sha512.o
|
obj-$(CONFIG_SHA512_ALGO) += sha512.o
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include <linux/bitops.h>
|
#include <linux/bitops.h>
|
||||||
#include <linux/compat.h>
|
#include <linux/compat.h>
|
||||||
#include <linux/asn1.h>
|
#include <linux/asn1.h>
|
||||||
#include <u-boot/rsa-checksum.h>
|
#include <u-boot/hash-checksum.h>
|
||||||
#include <crypto/public_key.h>
|
#include <crypto/public_key.h>
|
||||||
#include <crypto/pkcs7_parser.h>
|
#include <crypto/pkcs7_parser.h>
|
||||||
#else
|
#else
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#ifdef __UBOOT__
|
#ifdef __UBOOT__
|
||||||
#include <crypto/x509_parser.h>
|
#include <crypto/x509_parser.h>
|
||||||
#include <u-boot/rsa-checksum.h>
|
#include <u-boot/hash-checksum.h>
|
||||||
#else
|
#else
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <keys/asymmetric-subtype.h>
|
#include <keys/asymmetric-subtype.h>
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
#else
|
#else
|
||||||
#include "fdt_host.h"
|
#include "fdt_host.h"
|
||||||
#endif
|
#endif
|
||||||
#include <u-boot/rsa.h>
|
#include <hash.h>
|
||||||
|
#include <image.h>
|
||||||
|
|
||||||
int hash_calculate(const char *name,
|
int hash_calculate(const char *name,
|
||||||
const struct image_region region[],
|
const struct image_region region[],
|
@ -5,6 +5,6 @@
|
|||||||
# (C) Copyright 2000-2007
|
# (C) Copyright 2000-2007
|
||||||
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
||||||
|
|
||||||
obj-$(CONFIG_$(SPL_TPL_)RSA_VERIFY) += rsa-verify.o rsa-checksum.o
|
obj-$(CONFIG_$(SPL_TPL_)RSA_VERIFY) += rsa-verify.o
|
||||||
obj-$(CONFIG_$(SPL_TPL_)RSA_VERIFY_WITH_PKEY) += rsa-keyprop.o
|
obj-$(CONFIG_$(SPL_TPL_)RSA_VERIFY_WITH_PKEY) += rsa-keyprop.o
|
||||||
obj-$(CONFIG_RSA_SOFTWARE_EXP) += rsa-mod-exp.o
|
obj-$(CONFIG_RSA_SOFTWARE_EXP) += rsa-mod-exp.o
|
||||||
|
@ -67,7 +67,7 @@ LIBFDT_OBJS := $(addprefix libfdt/, fdt.o fdt_ro.o fdt_wip.o fdt_sw.o fdt_rw.o \
|
|||||||
fdt_strerror.o fdt_empty_tree.o fdt_addresses.o fdt_overlay.o)
|
fdt_strerror.o fdt_empty_tree.o fdt_addresses.o fdt_overlay.o)
|
||||||
|
|
||||||
RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \
|
RSA_OBJS-$(CONFIG_FIT_SIGNATURE) := $(addprefix lib/rsa/, \
|
||||||
rsa-sign.o rsa-verify.o rsa-checksum.o \
|
rsa-sign.o rsa-verify.o \
|
||||||
rsa-mod-exp.o)
|
rsa-mod-exp.o)
|
||||||
|
|
||||||
AES_OBJS-$(CONFIG_FIT_CIPHER) := $(addprefix lib/aes/, \
|
AES_OBJS-$(CONFIG_FIT_CIPHER) := $(addprefix lib/aes/, \
|
||||||
@ -106,6 +106,7 @@ dumpimage-mkimage-objs := aisimage.o \
|
|||||||
socfpgaimage.o \
|
socfpgaimage.o \
|
||||||
sunxi_egon.o \
|
sunxi_egon.o \
|
||||||
lib/crc16.o \
|
lib/crc16.o \
|
||||||
|
lib/hash-checksum.o \
|
||||||
lib/sha1.o \
|
lib/sha1.o \
|
||||||
lib/sha256.o \
|
lib/sha256.o \
|
||||||
lib/sha512.o \
|
lib/sha512.o \
|
||||||
|
Loading…
Reference in New Issue
Block a user