2019-01-16 12:33:22 -05:00
|
|
|
/* Copyright (c) 2014-2019, The Tor Project, Inc. */
|
2017-10-27 10:59:36 -04:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
2018-07-01 20:22:55 -04:00
|
|
|
/**
|
|
|
|
* \file crypto_pwbox.h
|
|
|
|
*
|
|
|
|
* \brief Header for crypto_pwbox.c
|
|
|
|
**/
|
|
|
|
|
2014-08-28 17:59:06 -04:00
|
|
|
#ifndef CRYPTO_PWBOX_H_INCLUDED_
|
|
|
|
#define CRYPTO_PWBOX_H_INCLUDED_
|
|
|
|
|
2018-06-21 12:20:52 -04:00
|
|
|
#include "lib/cc/torint.h"
|
2014-08-28 17:59:06 -04:00
|
|
|
|
|
|
|
#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);
|
|
|
|
|
2017-09-15 16:24:44 -04:00
|
|
|
#endif /* !defined(CRYPTO_PWBOX_H_INCLUDED_) */
|