From 25ccfff86a5b29c9c1ec9b3d01fe1dc796e9afa0 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 21 Jun 2018 12:46:11 -0400 Subject: 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. --- src/lib/crypt_ops/crypto_pwbox.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/lib/crypt_ops/crypto_pwbox.h (limited to 'src/lib/crypt_ops/crypto_pwbox.h') 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_) */ + -- cgit v1.2.3-54-g00ecf