diff options
| author | Mattias Andrée <m@maandree.se> | 2026-04-26 22:36:47 +0200 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-04-26 22:36:47 +0200 |
| commit | d77ab463184d113ca6119403887c9f4ed0dfdf0b (patch) | |
| tree | ca8a1de443f90a4b7def56ea5b61c96aaa949f45 /algorithms.h | |
| download | librecrypt-d77ab463184d113ca6119403887c9f4ed0dfdf0b.tar.gz librecrypt-d77ab463184d113ca6119403887c9f4ed0dfdf0b.tar.bz2 librecrypt-d77ab463184d113ca6119403887c9f4ed0dfdf0b.tar.xz | |
First commit
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
| -rw-r--r-- | algorithms.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/algorithms.h b/algorithms.h new file mode 100644 index 0000000..d38dcf5 --- /dev/null +++ b/algorithms.h @@ -0,0 +1,25 @@ +/* See LICENSE file for copyright and license details. */ +/* included from "common.h" */ + + +/* ordered by preference */ +#define LIST_ALGORITHMS(X) /* TODO add algorithms */ + + +#define Y(ALGO)\ + HIDDEN size_t librecrypt__##ALGO##__get_prefix(const char *settings, size_t len);\ + HIDDEN unsigned librecrypt__##ALGO##__is_algorithm(const char *settings, size_t len);\ + HIDDEN int librecrypt__##ALGO##__hash(char *restrict out_buffer, size_t size, const char *phrase,\ + size_t len, const char *settings, size_t prefix, void *reserved);\ + HIDDEN int librecrypt__##ALGO##__test_supported(const char *phrase, size_t len, int text,\ + const char *settings, size_t prefix);\ + HIDDEN ssize_t librecrypt__##ALGO##__make_settings(char *out_buffer, size_t size, const char *algorithm,\ + size_t memcost, uintmax_t timecost, int gensalt,\ + ssize_t (*rng)(void *out, size_t n, void *user), void *user);\ + NONSTRING extern const char librecrypt__##ALGO##__encoding_lut[256];\ + extern const unsigned char librecrypt__##ALGO##__decoding_lut[256]; + +#define X(ALGO) IF__##ALGO##__SUPPORTED(Y(ALGO)) +LIST_ALGORITHMS(X) +#undef X +#undef Y |
