summaryrefslogtreecommitdiff
path: root/src/lib/crypt_ops
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/crypt_ops
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/crypt_ops')
-rw-r--r--src/lib/crypt_ops/.may_include1
-rw-r--r--src/lib/crypt_ops/crypto_digest.c1
-rw-r--r--src/lib/crypt_ops/crypto_digest.h10
3 files changed, 2 insertions, 10 deletions
diff --git a/src/lib/crypt_ops/.may_include b/src/lib/crypt_ops/.may_include
index 6eefec1581..4f415f876e 100644
--- a/src/lib/crypt_ops/.may_include
+++ b/src/lib/crypt_ops/.may_include
@@ -2,6 +2,7 @@ orconfig.h
lib/cc/*.h
lib/crypt_ops/*.h
lib/ctime/*.h
+lib/defs/*.h
lib/err/*.h
lib/testsupport/testsupport.h
diff --git a/src/lib/crypt_ops/crypto_digest.c b/src/lib/crypt_ops/crypto_digest.c
index d746aaaca5..b6ec2b2841 100644
--- a/src/lib/crypt_ops/crypto_digest.c
+++ b/src/lib/crypt_ops/crypto_digest.c
@@ -580,4 +580,3 @@ crypto_xof_free_(crypto_xof_t *xof)
memwipe(xof, 0, sizeof(crypto_xof_t));
tor_free(xof);
}
-
diff --git a/src/lib/crypt_ops/crypto_digest.h b/src/lib/crypt_ops/crypto_digest.h
index 129258245e..63e8bec70b 100644
--- a/src/lib/crypt_ops/crypto_digest.h
+++ b/src/lib/crypt_ops/crypto_digest.h
@@ -17,14 +17,7 @@
#include "lib/container/container.h"
#include "lib/cc/torint.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
+#include "lib/defs/digest_sizes.h"
/** Length of a sha1 message digest when encoded in base32 with trailing =
* signs removed. */
@@ -133,4 +126,3 @@ digest_algorithm_t crypto_digest_get_algorithm(crypto_digest_t *digest);
#endif
#endif /* !defined(TOR_CRYPTO_DIGEST_H) */
-