aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypt_ops/crypto_pwbox.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/crypt_ops/crypto_pwbox.h')
-rw-r--r--src/lib/crypt_ops/crypto_pwbox.h23
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_) */
+