Steffen Jaeckel | 26dd993 | 2021-07-08 15:57:33 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* Copyright (C) 2020 Steffen Jaeckel <jaeckel-floss@eyet-services.de> */ |
| 3 | |
Tom Rini | 467382c | 2023-12-14 13:16:58 -0500 | [diff] [blame] | 4 | #include <linux/errno.h> |
| 5 | #include <linux/kernel.h> |
| 6 | #include <linux/string.h> |
Steffen Jaeckel | 26dd993 | 2021-07-08 15:57:33 +0200 | [diff] [blame] | 7 | #include <linux/types.h> |
| 8 | #include <vsprintf.h> |
| 9 | |
| 10 | #define NO_GENSALT |
| 11 | #define CRYPT_OUTPUT_SIZE 384 |
| 12 | #define ALG_SPECIFIC_SIZE 8192 |
| 13 | |
| 14 | #define ARG_UNUSED(x) (x) |
| 15 | |
| 16 | #define static_assert(a, b) _Static_assert(a, b) |
| 17 | |
| 18 | #define strtoul(cp, endp, base) simple_strtoul(cp, endp, base) |
| 19 | |
| 20 | extern const unsigned char ascii64[65]; |
| 21 | |
| 22 | #define b64t ((const char *)ascii64) |
| 23 | |
Steffen Jaeckel | 29bbe71 | 2021-07-08 15:57:34 +0200 | [diff] [blame] | 24 | int crypt_sha256crypt_rn_wrapped(const char *phrase, size_t phr_size, |
| 25 | const char *setting, |
| 26 | size_t ARG_UNUSED(set_size), uint8_t *output, |
| 27 | size_t out_size, void *scratch, |
| 28 | size_t scr_size); |
| 29 | int crypt_sha512crypt_rn_wrapped(const char *phrase, size_t phr_size, |
| 30 | const char *setting, |
| 31 | size_t ARG_UNUSED(set_size), uint8_t *output, |
| 32 | size_t out_size, void *scratch, |
| 33 | size_t scr_size); |