Poly1305.hpp 908 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c)2019 ZeroTier, Inc.
  3. *
  4. * Use of this software is governed by the Business Source License included
  5. * in the LICENSE.TXT file in the project's root directory.
  6. *
  7. * Change Date: 2023-01-01
  8. *
  9. * On the date above, in accordance with the Business Source License, use
  10. * of this software will be governed by version 2.0 of the Apache License.
  11. */
  12. /****/
  13. #ifndef ZT_POLY1305_HPP
  14. #define ZT_POLY1305_HPP
  15. namespace ZeroTier {
  16. #define ZT_POLY1305_KEY_LEN 32
  17. #define ZT_POLY1305_MAC_LEN 16
  18. /**
  19. * Compute a one-time authentication code
  20. *
  21. * @param auth Buffer to receive code -- MUST be 16 bytes in length
  22. * @param data Data to authenticate
  23. * @param len Length of data to authenticate in bytes
  24. * @param key 32-byte one-time use key to authenticate data (must not be reused)
  25. */
  26. void poly1305(void *auth,const void *data,unsigned int len,const void *key);
  27. } // namespace ZeroTier
  28. #endif