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