aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypt_ops/crypto_pwbox.h
blob: 5a26889fb2e51fa0093cfe4dfa47c8c9ebbe2782 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Copyright (c) 2014-2019, The Tor Project, Inc. */
/* See LICENSE for licensing information */

/**
 * \file crypto_pwbox.h
 *
 * \brief Header for crypto_pwbox.c
 **/

#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_) */