summaryrefslogtreecommitdiff
path: root/src/or/hs_descriptor.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-01-11 12:52:52 -0500
committerNick Mathewson <nickm@torproject.org>2017-01-11 12:52:52 -0500
commitac3b559e934b02d2fa690ea7dcd2e7e92553dc9e (patch)
treec47ffa1383441605ade9e0ef68150e505efaa2db /src/or/hs_descriptor.h
parentf31b3857febf793a12408dc60cd793fe85778637 (diff)
parent870b5e2227c4382aef1d98b1b5fc9d5f4d275c1c (diff)
downloadtor-ac3b559e934b02d2fa690ea7dcd2e7e92553dc9e.tar.gz
tor-ac3b559e934b02d2fa690ea7dcd2e7e92553dc9e.zip
Merge branch 'bug20569_030_02_squashed'
Diffstat (limited to 'src/or/hs_descriptor.h')
-rw-r--r--src/or/hs_descriptor.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/hs_descriptor.h b/src/or/hs_descriptor.h
index 6cc60c774c..b520d24471 100644
--- a/src/or/hs_descriptor.h
+++ b/src/or/hs_descriptor.h
@@ -40,7 +40,7 @@
/* Length of the KDF output value which is the length of the secret key,
* the secret IV and MAC key length which is the length of H() output. */
#define HS_DESC_ENCRYPTED_KDF_OUTPUT_LEN \
- CIPHER_KEY_LEN + CIPHER_IV_LEN + DIGEST256_LEN
+ CIPHER256_KEY_LEN + CIPHER_IV_LEN + DIGEST256_LEN
/* We need to pad the plaintext version of the encrypted data section before
* encryption and it has to be a multiple of this value. */
#define HS_DESC_PLAINTEXT_PADDING_MULTIPLE 128
@@ -60,6 +60,12 @@
* view of a descriptor, is 1 that is the version field. */
#define HS_DESC_PLAINTEXT_MIN_FIELDS 1
+/* Key length for the descriptor symmetric encryption. As specified in the
+ * protocol, we use AES-256 for the encrypted section of the descriptor. The
+ * following is the length in bytes and the bit size. */
+#define HS_DESC_ENCRYPTED_KEY_LEN CIPHER256_KEY_LEN
+#define HS_DESC_ENCRYPTED_BIT_SIZE (HS_DESC_ENCRYPTED_KEY_LEN * 8)
+
/* Type of authentication in the descriptor. */
typedef enum {
HS_DESC_AUTH_PASSWORD = 1,