blob: 50dde68b5cdec8d483c4b8e091f8ebce2ac1f76f [file] [log] [blame]
Steffen Jaeckel26dd9932021-07-08 15:57:33 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2/* Copyright (C) 2020 Steffen Jaeckel <jaeckel-floss@eyet-services.de> */
3
Tom Rini467382c2023-12-14 13:16:58 -05004#include <linux/errno.h>
5#include <linux/kernel.h>
6#include <linux/string.h>
Steffen Jaeckel26dd9932021-07-08 15:57:33 +02007#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
20extern const unsigned char ascii64[65];
21
22#define b64t ((const char *)ascii64)
23
Steffen Jaeckel29bbe712021-07-08 15:57:34 +020024int 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);
29int 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);