crypto_pwbox.h 691 B

1234567891011121314151617181920212223
  1. /* Copyright (c) 2014-2017, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. #ifndef CRYPTO_PWBOX_H_INCLUDED_
  4. #define CRYPTO_PWBOX_H_INCLUDED_
  5. #include "torint.h"
  6. #define UNPWBOX_OKAY 0
  7. #define UNPWBOX_BAD_SECRET -1
  8. #define UNPWBOX_CORRUPTED -2
  9. int crypto_pwbox(uint8_t **out, size_t *outlen_out,
  10. const uint8_t *inp, size_t input_len,
  11. const char *secret, size_t secret_len,
  12. unsigned s2k_flags);
  13. int crypto_unpwbox(uint8_t **out, size_t *outlen_out,
  14. const uint8_t *inp, size_t input_len,
  15. const char *secret, size_t secret_len);
  16. #endif /* !defined(CRYPTO_PWBOX_H_INCLUDED_) */