aboutsummaryrefslogtreecommitdiff
path: root/src/lib/defs
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-21 16:34:00 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-22 09:49:13 -0400
commit932b4d0a4342ec281b6f692f23453d6c46026c18 (patch)
tree7495d70fd2f2390d351917ce1421e80be43fa3d2 /src/lib/defs
parent479c2ab503a3a051200339a7df9a99dcfb0ed976 (diff)
downloadtor-932b4d0a4342ec281b6f692f23453d6c46026c18.tar.gz
tor-932b4d0a4342ec281b6f692f23453d6c46026c18.zip
Remove container->crypto dependency
Containers were using crypto_digest.h, just to see the value of DIGEST_LEN. Moved those constants into a new defs module.
Diffstat (limited to 'src/lib/defs')
-rw-r--r--src/lib/defs/.may_include1
-rw-r--r--src/lib/defs/digest_sizes.h18
-rw-r--r--src/lib/defs/include.am3
3 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/defs/.may_include b/src/lib/defs/.may_include
new file mode 100644
index 0000000000..2b06e8519c
--- /dev/null
+++ b/src/lib/defs/.may_include
@@ -0,0 +1 @@
+orconfig.h
diff --git a/src/lib/defs/digest_sizes.h b/src/lib/defs/digest_sizes.h
new file mode 100644
index 0000000000..f426fff20d
--- /dev/null
+++ b/src/lib/defs/digest_sizes.h
@@ -0,0 +1,18 @@
+/* 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_DIGEST_SIZES_H
+#define TOR_DIGEST_SIZES_H
+
+/** Length of the output of our message digest. */
+#define DIGEST_LEN 20
+/** Length of the output of our second (improved) message digests. (For now
+ * this is just sha256, but it could be any other 256-bit digest.) */
+#define DIGEST256_LEN 32
+/** Length of the output of our 64-bit optimized message digests (SHA512). */
+#define DIGEST512_LEN 64
+
+#endif
diff --git a/src/lib/defs/include.am b/src/lib/defs/include.am
new file mode 100644
index 0000000000..861406c01d
--- /dev/null
+++ b/src/lib/defs/include.am
@@ -0,0 +1,3 @@
+
+noinst_HEADERS += \
+ digest_sizes.h