aboutsummaryrefslogtreecommitdiff
path: root/include/crypt.h
diff options
context:
space:
mode:
authorSteffen Jaeckel <jaeckel-floss@eyet-services.de>2021-07-08 15:57:33 +0200
committerTom Rini <trini@konsulko.com>2021-07-23 13:36:14 -0400
commit26dd9936574864155b989b9f14319ca2779f0598 (patch)
tree41fe3ce1471a80916ea6cc91d8a6e7c956c8e2d9 /include/crypt.h
parentc74675bd904b6ce9d5820a80f27793c0583fd54c (diff)
downloadu-boot-26dd9936574864155b989b9f14319ca2779f0598.zip
u-boot-26dd9936574864155b989b9f14319ca2779f0598.tar.gz
u-boot-26dd9936574864155b989b9f14319ca2779f0598.tar.bz2
lib: add crypt subsystem
Add the basic functionality required to support the standard crypt format. The files crypt-sha256.c and crypt-sha512.c originate from libxcrypt and their formatting is therefor retained. The integration is done via a crypt_compare() function in crypt.c. ``` libxcrypt $ git describe --long --always --all tags/v4.4.17-0-g6b110bc ``` Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'include/crypt.h')
-rw-r--r--include/crypt.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/crypt.h b/include/crypt.h
new file mode 100644
index 0000000..e0be283
--- /dev/null
+++ b/include/crypt.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (C) 2020 Steffen Jaeckel <jaeckel-floss@eyet-services.de> */
+
+/**
+ * Compare should with the processed passphrase.
+ *
+ * @should The crypt-style string to compare against
+ * @passphrase The plaintext passphrase
+ * @equal Pointer to an int where the result is stored
+ * '0' = unequal
+ * '1' = equal
+ */
+void crypt_compare(const char *should, const char *passphrase, int *equal);