diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-21 12:46:11 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-21 13:14:14 -0400 |
commit | 25ccfff86a5b29c9c1ec9b3d01fe1dc796e9afa0 (patch) | |
tree | 1c23ec9dd2cea5d00e4262fa4574ffdb9e250aa7 /src/lib/crypt_ops/crypto_pwbox.h | |
parent | 49d7c9ce53daa13daae59eedceb07d28e06e4395 (diff) | |
download | tor-25ccfff86a5b29c9c1ec9b3d01fe1dc796e9afa0.tar.gz tor-25ccfff86a5b29c9c1ec9b3d01fe1dc796e9afa0.zip |
Split crypto and tls libraries into directories
I am calling the crypto library "crypt_ops", since I want
higher-level crypto things to be separated from lower-level ones.
This library will hold only the low-level ones, once we have it
refactored.
Diffstat (limited to 'src/lib/crypt_ops/crypto_pwbox.h')
-rw-r--r-- | src/lib/crypt_ops/crypto_pwbox.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/crypt_ops/crypto_pwbox.h b/src/lib/crypt_ops/crypto_pwbox.h new file mode 100644 index 0000000000..9ed35a150e --- /dev/null +++ b/src/lib/crypt_ops/crypto_pwbox.h @@ -0,0 +1,23 @@ +/* Copyright (c) 2014-2018, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +#ifndef CRYPTO_PWBOX_H_INCLUDED_ +#define CRYPTO_PWBOX_H_INCLUDED_ + +#include "lib/cc/torint.h" + +#define UNPWBOX_OKAY 0 +#define UNPWBOX_BAD_SECRET -1 +#define UNPWBOX_CORRUPTED -2 + +int crypto_pwbox(uint8_t **out, size_t *outlen_out, + const uint8_t *inp, size_t input_len, + const char *secret, size_t secret_len, + unsigned s2k_flags); + +int crypto_unpwbox(uint8_t **out, size_t *outlen_out, + const uint8_t *inp, size_t input_len, + const char *secret, size_t secret_len); + +#endif /* !defined(CRYPTO_PWBOX_H_INCLUDED_) */ + |