crypt.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* This file is part of libmissive.
  2. *
  3. * libmissive is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU Lesser General Public License as published by
  5. * the Free Software Foundation, either version 3 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * libmissive is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU Lesser General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU Lesser General Public License
  14. * along with libmissive. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef MISV_CRYPT_H
  17. #define MISV_CRYPT_H
  18. #include <epistle/message.h>
  19. #include <sodium.h>
  20. typedef unsigned char Nonce[crypto_box_NONCEBYTES];
  21. typedef unsigned char Box_pkey[crypto_box_PUBLICKEYBYTES];
  22. typedef unsigned char Box_skey[crypto_box_SECRETKEYBYTES];
  23. typedef unsigned char Sign_pkey[crypto_sign_PUBLICKEYBYTES];
  24. typedef unsigned char Sign_skey[crypto_sign_SECRETKEYBYTES];
  25. int
  26. nonce_update(Nonce current, const Nonce newer);
  27. void
  28. box_keys(Box_skey skey, Box_pkey pkey);
  29. void
  30. sign_keys(Sign_skey skey, Sign_pkey pkey);
  31. #endif