summaryrefslogtreecommitdiffstats
path: root/include/crypto
diff options
context:
space:
mode:
authorRouven Czerwinski <r.czerwinski@pengutronix.de>2019-08-06 07:11:00 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-08-07 09:42:15 +0200
commita3a1b708ee192d02603f615d08bfa934ed9464ea (patch)
tree220176daae30d784f6b86f56d663e8fd70406b59 /include/crypto
parent907a76d4eb2ad7e6850cc5fab1fa2cc8fb489aeb (diff)
downloadbarebox-a3a1b708ee192d02603f615d08bfa934ed9464ea.tar.gz
barebox-a3a1b708ee192d02603f615d08bfa934ed9464ea.tar.xz
pbl: add sha256 and piggy verification to PBL
Extract the necessary functions from sha256 into a PBL headder and add a verification function to the PBL. The function will be called before the individual architectures decompress functions is run. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/crypto')
-rw-r--r--include/crypto/pbl-sha.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/crypto/pbl-sha.h b/include/crypto/pbl-sha.h
new file mode 100644
index 0000000000..7d323ab479
--- /dev/null
+++ b/include/crypto/pbl-sha.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __PBL_SHA_H_
+
+#define __PBL_SHA_H_
+
+#include <digest.h>
+#include <types.h>
+
+int sha256_init(struct digest *desc);
+int sha256_update(struct digest *desc, const void *data, unsigned long len);
+int sha256_final(struct digest *desc, u8 *out);
+
+#endif /* __PBL-SHA_H_ */