mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-09-21 21:44:58 +02:00
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.
This commit is contained in:
parent
479c2ab503
commit
932b4d0a43
@ -5,6 +5,7 @@ include src/lib/ctime/include.am
|
|||||||
include src/lib/compress/include.am
|
include src/lib/compress/include.am
|
||||||
include src/lib/container/include.am
|
include src/lib/container/include.am
|
||||||
include src/lib/crypt_ops/include.am
|
include src/lib/crypt_ops/include.am
|
||||||
|
include src/lib/defs/include.am
|
||||||
include src/lib/include.libdonna.am
|
include src/lib/include.libdonna.am
|
||||||
include src/lib/malloc/include.am
|
include src/lib/malloc/include.am
|
||||||
include src/lib/testsupport/include.am
|
include src/lib/testsupport/include.am
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "lib/container/map.h"
|
#include "lib/container/map.h"
|
||||||
#include "lib/ctime/di_ops.h"
|
#include "lib/ctime/di_ops.h"
|
||||||
#include "lib/crypt_ops/crypto_digest.h"
|
#include "lib/defs/digest_sizes.h"
|
||||||
|
|
||||||
#include "common/util_bug.h"
|
#include "common/util_bug.h"
|
||||||
#include "common/util.h" // For strlower
|
#include "common/util.h" // For strlower
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include "lib/container/smartlist.h"
|
#include "lib/container/smartlist.h"
|
||||||
#include "lib/err/torerr.h"
|
#include "lib/err/torerr.h"
|
||||||
#include "common/util.h" // For strstrip.
|
#include "common/util.h" // For strstrip.
|
||||||
#include "lib/crypt_ops/crypto_digest.h"
|
#include "lib/defs/digest_sizes.h"
|
||||||
#include "lib/ctime/di_ops.h"
|
#include "lib/ctime/di_ops.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -2,6 +2,7 @@ orconfig.h
|
|||||||
lib/cc/*.h
|
lib/cc/*.h
|
||||||
lib/crypt_ops/*.h
|
lib/crypt_ops/*.h
|
||||||
lib/ctime/*.h
|
lib/ctime/*.h
|
||||||
|
lib/defs/*.h
|
||||||
lib/err/*.h
|
lib/err/*.h
|
||||||
lib/testsupport/testsupport.h
|
lib/testsupport/testsupport.h
|
||||||
|
|
||||||
|
@ -580,4 +580,3 @@ crypto_xof_free_(crypto_xof_t *xof)
|
|||||||
memwipe(xof, 0, sizeof(crypto_xof_t));
|
memwipe(xof, 0, sizeof(crypto_xof_t));
|
||||||
tor_free(xof);
|
tor_free(xof);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,14 +17,7 @@
|
|||||||
|
|
||||||
#include "lib/container/container.h"
|
#include "lib/container/container.h"
|
||||||
#include "lib/cc/torint.h"
|
#include "lib/cc/torint.h"
|
||||||
|
#include "lib/defs/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
|
|
||||||
|
|
||||||
/** Length of a sha1 message digest when encoded in base32 with trailing =
|
/** Length of a sha1 message digest when encoded in base32 with trailing =
|
||||||
* signs removed. */
|
* signs removed. */
|
||||||
@ -133,4 +126,3 @@ digest_algorithm_t crypto_digest_get_algorithm(crypto_digest_t *digest);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* !defined(TOR_CRYPTO_DIGEST_H) */
|
#endif /* !defined(TOR_CRYPTO_DIGEST_H) */
|
||||||
|
|
||||||
|
1
src/lib/defs/.may_include
Normal file
1
src/lib/defs/.may_include
Normal file
@ -0,0 +1 @@
|
|||||||
|
orconfig.h
|
18
src/lib/defs/digest_sizes.h
Normal file
18
src/lib/defs/digest_sizes.h
Normal file
@ -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
|
3
src/lib/defs/include.am
Normal file
3
src/lib/defs/include.am
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
noinst_HEADERS += \
|
||||||
|
digest_sizes.h
|
Loading…
Reference in New Issue
Block a user