x25519_sizes.h 1019 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* Copyright (c) 2001, Matej Pfajfar.
  2. * Copyright (c) 2001-2004, Roger Dingledine.
  3. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  4. * Copyright (c) 2007-2018, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file x25519_sizes.h
  8. * \brief Definitions for sizes of x25519 keys and elements.
  9. *
  10. * Tor uses these definitions throughout its codebase, even in parts that
  11. * don't actually do any x25519 calculations.
  12. **/
  13. #ifndef TOR_X25519_SIZES_H
  14. #define TOR_X25519_SIZES_H
  15. /** Length of a curve25519 public key when encoded. */
  16. #define CURVE25519_PUBKEY_LEN 32
  17. /** Length of a curve25519 secret key when encoded. */
  18. #define CURVE25519_SECKEY_LEN 32
  19. /** Length of the result of a curve25519 handshake. */
  20. #define CURVE25519_OUTPUT_LEN 32
  21. #define ED25519_PUBKEY_LEN 32
  22. #define ED25519_SECKEY_LEN 64
  23. #define ED25519_SECKEY_SEED_LEN 32
  24. #define ED25519_SIG_LEN 64
  25. #define CURVE25519_BASE64_PADDED_LEN 44
  26. #define ED25519_BASE64_LEN 43
  27. #define ED25519_SIG_BASE64_LEN 86
  28. #endif