crypto_pwbox.h 770 B

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