diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-07-03 11:09:54 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-07-03 11:09:54 -0400 |
commit | 77e678c20daf8633ce1904dd1df28398d820f7c0 (patch) | |
tree | 411cb587ea7533b65edf60c8bc2221b072dda807 /src/lib/defs | |
parent | a01b4d7f87f2217f55f5c5113fe19a2d3081a44c (diff) | |
parent | 518ebe14dcc7568da353c4c517039d0c621deb28 (diff) | |
download | tor-77e678c20daf8633ce1904dd1df28398d820f7c0.tar.gz tor-77e678c20daf8633ce1904dd1df28398d820f7c0.zip |
Merge remote-tracking branch 'github/shrink_or_h_more'
Diffstat (limited to 'src/lib/defs')
-rw-r--r-- | src/lib/defs/dh_sizes.h | 13 | ||||
-rw-r--r-- | src/lib/defs/include.am | 6 | ||||
-rw-r--r-- | src/lib/defs/x25519_sizes.h | 27 |
3 files changed, 44 insertions, 2 deletions
diff --git a/src/lib/defs/dh_sizes.h b/src/lib/defs/dh_sizes.h new file mode 100644 index 0000000000..b60957281c --- /dev/null +++ b/src/lib/defs/dh_sizes.h @@ -0,0 +1,13 @@ +/* Copyright (c) 2001, Matej Pfajfar. + * Copyright (c) 2001-2004, Roger Dingledine. + * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. + * Copyright (c) 2007-2018, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +#ifndef TOR_DH_SIZES_H +#define TOR_DH_SIZES_H + +/** Length of our legacy DH keys. */ +#define DH1024_KEY_LEN (1024/8) + +#endif diff --git a/src/lib/defs/include.am b/src/lib/defs/include.am index ff48cff07c..48ee7f29fc 100644 --- a/src/lib/defs/include.am +++ b/src/lib/defs/include.am @@ -1,3 +1,5 @@ -noinst_HEADERS += \ - src/lib/defs/digest_sizes.h +noinst_HEADERS += \ + src/lib/defs/dh_sizes.h \ + src/lib/defs/digest_sizes.h \ + src/lib/defs/x25519_sizes.h diff --git a/src/lib/defs/x25519_sizes.h b/src/lib/defs/x25519_sizes.h new file mode 100644 index 0000000000..adaaab8c4d --- /dev/null +++ b/src/lib/defs/x25519_sizes.h @@ -0,0 +1,27 @@ +/* Copyright (c) 2001, Matej Pfajfar. + * Copyright (c) 2001-2004, Roger Dingledine. + * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. + * Copyright (c) 2007-2018, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +#ifndef TOR_X25519_SIZES_H +#define TOR_X25519_SIZES_H + +/** Length of a curve25519 public key when encoded. */ +#define CURVE25519_PUBKEY_LEN 32 +/** Length of a curve25519 secret key when encoded. */ +#define CURVE25519_SECKEY_LEN 32 +/** Length of the result of a curve25519 handshake. */ +#define CURVE25519_OUTPUT_LEN 32 + +#define ED25519_PUBKEY_LEN 32 +#define ED25519_SECKEY_LEN 64 +#define ED25519_SECKEY_SEED_LEN 32 +#define ED25519_SIG_LEN 64 + +#define CURVE25519_BASE64_PADDED_LEN 44 + +#define ED25519_BASE64_LEN 43 +#define ED25519_SIG_BASE64_LEN 86 + +#endif |