[PATCH 1/5] lib: add crypt subsystem

Simon Glass sjg at chromium.org
Wed Apr 21 09:14:41 CEST 2021


On Tue, 13 Apr 2021 at 10:16, Steffen Jaeckel
<jaeckel-floss at eyet-services.de> wrote:
>
> 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 at eyet-services.de>
> ---
>
>  include/crypt.h          |  13 ++
>  lib/Kconfig              |   1 +
>  lib/Makefile             |   1 +
>  lib/crypt/Kconfig        |  29 ++++
>  lib/crypt/Makefile       |  10 ++
>  lib/crypt/alg-sha256.h   |  17 ++
>  lib/crypt/alg-sha512.h   |  17 ++
>  lib/crypt/crypt-port.h   |  28 ++++
>  lib/crypt/crypt-sha256.c | 313 +++++++++++++++++++++++++++++++++++++
>  lib/crypt/crypt-sha512.c | 328 +++++++++++++++++++++++++++++++++++++++
>  lib/crypt/crypt.c        |  73 +++++++++
>  11 files changed, 830 insertions(+)
>  create mode 100644 include/crypt.h
>  create mode 100644 lib/crypt/Kconfig
>  create mode 100644 lib/crypt/Makefile
>  create mode 100644 lib/crypt/alg-sha256.h
>  create mode 100644 lib/crypt/alg-sha512.h
>  create mode 100644 lib/crypt/crypt-port.h
>  create mode 100644 lib/crypt/crypt-sha256.c
>  create mode 100644 lib/crypt/crypt-sha512.c
>  create mode 100644 lib/crypt/crypt.c

This seems to use errno - is that necessary? Also are there any simple
unit tests we could usefully bring over?

Regards,
Simon


More information about the U-Boot mailing list