aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypt_ops/crypto_ed25519.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-01 13:04:21 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-01 15:20:37 -0400
commit1743dac078f2e060f3f6c7194deae90a2175fe92 (patch)
tree4cd48e47e5acb70a457bf4dbddc0808c367c4b2c /src/lib/crypt_ops/crypto_ed25519.h
parent500826479aaf7d398f576fabbfdf34b17604f646 (diff)
downloadtor-1743dac078f2e060f3f6c7194deae90a2175fe92.tar.gz
tor-1743dac078f2e060f3f6c7194deae90a2175fe92.zip
Minimize headers that include crypto_formats and x25519 stuff
Diffstat (limited to 'src/lib/crypt_ops/crypto_ed25519.h')
-rw-r--r--src/lib/crypt_ops/crypto_ed25519.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/lib/crypt_ops/crypto_ed25519.h b/src/lib/crypt_ops/crypto_ed25519.h
index 7255a3ec9b..5ecd4530d8 100644
--- a/src/lib/crypt_ops/crypto_ed25519.h
+++ b/src/lib/crypt_ops/crypto_ed25519.h
@@ -7,24 +7,20 @@
#include "lib/testsupport/testsupport.h"
#include "lib/cc/torint.h"
#include "lib/crypt_ops/crypto_curve25519.h"
-
-#define ED25519_PUBKEY_LEN 32
-#define ED25519_SECKEY_LEN 64
-#define ED25519_SECKEY_SEED_LEN 32
-#define ED25519_SIG_LEN 64
+#include "lib/defs/x25519_sizes.h"
/** An Ed25519 signature. */
-typedef struct {
+typedef struct ed25519_signature_t {
uint8_t sig[ED25519_SIG_LEN];
} ed25519_signature_t;
/** An Ed25519 public key */
-typedef struct {
+typedef struct ed25519_public_key_t {
uint8_t pubkey[ED25519_PUBKEY_LEN];
} ed25519_public_key_t;
/** An Ed25519 secret key */
-typedef struct {
+typedef struct ed25519_secret_key_t {
/** Note that we store secret keys in an expanded format that doesn't match
* the format from standard ed25519. Ed25519 stores a 32-byte value k and
* expands it into a 64-byte H(k), using the first 32 bytes for a multiplier
@@ -35,7 +31,7 @@ typedef struct {
} ed25519_secret_key_t;
/** An Ed25519 keypair. */
-typedef struct {
+typedef struct ed25519_keypair_t {
ed25519_public_key_t pubkey;
ed25519_secret_key_t seckey;
} ed25519_keypair_t;