Tor  0.4.7.0-alpha-dev
crypto_pwbox.h
Go to the documentation of this file.
1 /* Copyright (c) 2014-2021, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
4 /**
5  * \file crypto_pwbox.h
6  *
7  * \brief Header for crypto_pwbox.c
8  **/
9 
10 #ifndef CRYPTO_PWBOX_H_INCLUDED_
11 #define CRYPTO_PWBOX_H_INCLUDED_
12 
13 #include "lib/cc/torint.h"
14 
15 #define UNPWBOX_OKAY 0
16 #define UNPWBOX_BAD_SECRET -1
17 #define UNPWBOX_CORRUPTED -2
18 
19 int crypto_pwbox(uint8_t **out, size_t *outlen_out,
20  const uint8_t *inp, size_t input_len,
21  const char *secret, size_t secret_len,
22  unsigned s2k_flags);
23 
24 int crypto_unpwbox(uint8_t **out, size_t *outlen_out,
25  const uint8_t *inp, size_t input_len,
26  const char *secret, size_t secret_len);
27 
28 #endif /* !defined(CRYPTO_PWBOX_H_INCLUDED_) */
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)
Definition: crypto_pwbox.c:47
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)
Definition: crypto_pwbox.c:153
Integer definitions used throughout Tor.