Rename crypto.c to crypto_cipher.c (since that's all it still has.)

This commit is contained in:
Nick Mathewson 2018-07-11 14:08:22 -04:00
parent 9010797e63
commit f45107e7de
22 changed files with 32 additions and 34 deletions

View File

@ -22,7 +22,7 @@
#define ONION_NTOR_PRIVATE #define ONION_NTOR_PRIVATE
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_digest.h" #include "lib/crypt_ops/crypto_digest.h"
#include "lib/crypt_ops/crypto_hkdf.h" #include "lib/crypt_ops/crypto_hkdf.h"
#include "lib/crypt_ops/crypto_util.h" #include "lib/crypt_ops/crypto_util.h"

View File

@ -7,7 +7,7 @@
#include "core/or/or.h" #include "core/or/or.h"
#include "core/or/circuitlist.h" #include "core/or/circuitlist.h"
#include "app/config/config.h" #include "app/config/config.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_util.h" #include "lib/crypt_ops/crypto_util.h"
#include "core/crypto/hs_ntor.h" // for HS_NTOR_KEY_EXPANSION_KDF_OUT_LEN #include "core/crypto/hs_ntor.h" // for HS_NTOR_KEY_EXPANSION_KDF_OUT_LEN
#include "core/or/relay.h" #include "core/or/relay.h"

View File

@ -27,7 +27,8 @@
#include "lib/cc/torint.h" #include "lib/cc/torint.h"
#include "lib/container/map.h" #include "lib/container/map.h"
#include "lib/container/smartlist.h" #include "lib/container/smartlist.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_rsa.h"
#include "lib/ctime/di_ops.h" #include "lib/ctime/di_ops.h"
#include "lib/defs/dh_sizes.h" #include "lib/defs/dh_sizes.h"
#include "lib/encoding/binascii.h" #include "lib/encoding/binascii.h"

View File

@ -14,7 +14,7 @@
#include "lib/string/util_string.h" #include "lib/string/util_string.h"
#include "lib/string/printf.h" #include "lib/string/printf.h"
#include "lib/memarea/memarea.h" #include "lib/memarea/memarea.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_rsa.h"
#include <string.h> #include <string.h>

View File

@ -12,7 +12,7 @@
#include "core/or/circuitlist.h" #include "core/or/circuitlist.h"
#include "core/or/circuituse.h" #include "core/or/circuituse.h"
#include "app/config/config.h" #include "app/config/config.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "core/or/dos.h" #include "core/or/dos.h"
#include "core/or/relay.h" #include "core/or/relay.h"
#include "feature/rend/rendmid.h" #include "feature/rend/rendmid.h"

View File

@ -5,15 +5,13 @@
/* See LICENSE for licensing information */ /* See LICENSE for licensing information */
/** /**
* \file crypto.c * \file crypto_cipher.c
* \brief Wrapper functions to present a consistent interface to * \brief Symmetric cryptography (low-level) with AES.
* public-key and symmetric cryptography operations from OpenSSL and
* other places.
**/ **/
#include "orconfig.h" #include "orconfig.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_rand.h" #include "lib/crypt_ops/crypto_rand.h"
#include "lib/crypt_ops/crypto_util.h" #include "lib/crypt_ops/crypto_util.h"

View File

@ -5,19 +5,18 @@
/* See LICENSE for licensing information */ /* See LICENSE for licensing information */
/** /**
* \file crypto.h * \file crypto_cipher.h
* *
* \brief Headers for crypto.c * \brief Headers for crypto_cipher.c
**/ **/
#ifndef TOR_CRYPTO_H #ifndef TOR_CRYPTO_CIPHER_H
#define TOR_CRYPTO_H #define TOR_CRYPTO_CIPHER_H
#include "orconfig.h" #include "orconfig.h"
#include <stdio.h> #include <stdio.h>
#include "lib/cc/torint.h" #include "lib/cc/torint.h"
#include "lib/crypt_ops/crypto_rsa.h"
/** Length of our symmetric cipher's keys of 128-bit. */ /** Length of our symmetric cipher's keys of 128-bit. */
#define CIPHER_KEY_LEN 16 #define CIPHER_KEY_LEN 16
@ -26,10 +25,6 @@
/** Length of our symmetric cipher's keys of 256-bit. */ /** Length of our symmetric cipher's keys of 256-bit. */
#define CIPHER256_KEY_LEN 32 #define CIPHER256_KEY_LEN 32
/** Length of encoded public key fingerprints, including space; but not
* including terminating NUL. */
#define FINGERPRINT_LEN 49
typedef struct aes_cnt_cipher crypto_cipher_t; typedef struct aes_cnt_cipher crypto_cipher_t;
/* environment setup */ /* environment setup */

View File

@ -11,7 +11,7 @@
#include <string.h> #include <string.h>
#include "lib/arch/bytes.h" #include "lib/arch/bytes.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_digest.h" #include "lib/crypt_ops/crypto_digest.h"
#include "lib/crypt_ops/crypto_pwbox.h" #include "lib/crypt_ops/crypto_pwbox.h"
#include "lib/crypt_ops/crypto_rand.h" #include "lib/crypt_ops/crypto_rand.h"

View File

@ -9,7 +9,7 @@
* \brief Block of functions related with RSA utilities and operations. * \brief Block of functions related with RSA utilities and operations.
**/ **/
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_curve25519.h" #include "lib/crypt_ops/crypto_curve25519.h"
#include "lib/crypt_ops/crypto_digest.h" #include "lib/crypt_ops/crypto_digest.h"
#include "lib/crypt_ops/crypto_format.h" #include "lib/crypt_ops/crypto_format.h"

View File

@ -29,6 +29,10 @@
/** Number of bytes added for PKCS1-OAEP padding. */ /** Number of bytes added for PKCS1-OAEP padding. */
#define PKCS1_OAEP_PADDING_OVERHEAD 42 #define PKCS1_OAEP_PADDING_OVERHEAD 42
/** Length of encoded public key fingerprints, including space; but not
* including terminating NUL. */
#define FINGERPRINT_LEN 49
/** A public key, or a public/private key-pair. */ /** A public key, or a public/private key-pair. */
typedef struct crypto_pk_t crypto_pk_t; typedef struct crypto_pk_t crypto_pk_t;

View File

@ -12,7 +12,7 @@
#define CRYPTO_S2K_PRIVATE #define CRYPTO_S2K_PRIVATE
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_digest.h" #include "lib/crypt_ops/crypto_digest.h"
#include "lib/crypt_ops/crypto_hkdf.h" #include "lib/crypt_ops/crypto_hkdf.h"
#include "lib/crypt_ops/crypto_rand.h" #include "lib/crypt_ops/crypto_rand.h"

View File

@ -7,7 +7,7 @@ endif
src_lib_libtor_crypt_ops_a_SOURCES = \ src_lib_libtor_crypt_ops_a_SOURCES = \
src/lib/crypt_ops/aes.c \ src/lib/crypt_ops/aes.c \
src/lib/crypt_ops/crypto.c \ src/lib/crypt_ops/crypto_cipher.c \
src/lib/crypt_ops/crypto_curve25519.c \ src/lib/crypt_ops/crypto_curve25519.c \
src/lib/crypt_ops/crypto_dh.c \ src/lib/crypt_ops/crypto_dh.c \
src/lib/crypt_ops/crypto_digest.c \ src/lib/crypt_ops/crypto_digest.c \
@ -39,7 +39,7 @@ noinst_HEADERS += \
src/lib/crypt_ops/crypto_digest.h \ src/lib/crypt_ops/crypto_digest.h \
src/lib/crypt_ops/crypto_ed25519.h \ src/lib/crypt_ops/crypto_ed25519.h \
src/lib/crypt_ops/crypto_format.h \ src/lib/crypt_ops/crypto_format.h \
src/lib/crypt_ops/crypto.h \ src/lib/crypt_ops/crypto_cipher.h \
src/lib/crypt_ops/crypto_hkdf.h \ src/lib/crypt_ops/crypto_hkdf.h \
src/lib/crypt_ops/crypto_init.h \ src/lib/crypt_ops/crypto_init.h \
src/lib/crypt_ops/crypto_openssl_mgt.h \ src/lib/crypt_ops/crypto_openssl_mgt.h \

View File

@ -24,7 +24,7 @@
#include <ws2tcpip.h> #include <ws2tcpip.h>
#endif #endif
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_rand.h" #include "lib/crypt_ops/crypto_rand.h"
#include "lib/crypt_ops/crypto_dh.h" #include "lib/crypt_ops/crypto_dh.h"
#include "lib/crypt_ops/crypto_util.h" #include "lib/crypt_ops/crypto_util.h"

View File

@ -7,7 +7,7 @@
#include "app/config/config.h" #include "app/config/config.h"
#include "test/fuzz/fuzzing.h" #include "test/fuzz/fuzzing.h"
#include "lib/compress/compress.h" #include "lib/compress/compress.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_ed25519.h" #include "lib/crypt_ops/crypto_ed25519.h"
static or_options_t *mock_options = NULL; static or_options_t *mock_options = NULL;

View File

@ -21,7 +21,7 @@
#include "test/hs_test_helpers.h" #include "test/hs_test_helpers.h"
#include "app/config/config.h" #include "app/config/config.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_dh.h" #include "lib/crypt_ops/crypto_dh.h"
#include "core/or/channeltls.h" #include "core/or/channeltls.h"
#include "feature/dircache/directory.h" #include "feature/dircache/directory.h"

View File

@ -14,7 +14,7 @@
#define ONION_NTOR_PRIVATE #define ONION_NTOR_PRIVATE
#include "core/or/or.h" #include "core/or/or.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_curve25519.h" #include "lib/crypt_ops/crypto_curve25519.h"
#include "lib/crypt_ops/crypto_ed25519.h" #include "lib/crypt_ops/crypto_ed25519.h"
#include "lib/crypt_ops/crypto_format.h" #include "lib/crypt_ops/crypto_format.h"

View File

@ -2,7 +2,7 @@
/* See LICENSE for licensing information */ /* See LICENSE for licensing information */
#include "orconfig.h" #include "orconfig.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "core/or/or.h" #include "core/or/or.h"
#include "test/test.h" #include "test/test.h"

View File

@ -7,7 +7,7 @@
#define ONION_NTOR_PRIVATE #define ONION_NTOR_PRIVATE
#include "core/or/or.h" #include "core/or/or.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_curve25519.h" #include "lib/crypt_ops/crypto_curve25519.h"
#include "core/crypto/onion_ntor.h" #include "core/crypto/onion_ntor.h"

View File

@ -9,7 +9,7 @@
#include "core/mainloop/main.h" #include "core/mainloop/main.h"
#include "app/config/config.h" #include "app/config/config.h"
#include "core/mainloop/connection.h" #include "core/mainloop/connection.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "core/or/circuitbuild.h" #include "core/or/circuitbuild.h"
#include "core/or/circuitlist.h" #include "core/or/circuitlist.h"
#include "core/or/connection_edge.h" #include "core/or/connection_edge.h"

View File

@ -9,7 +9,7 @@
#include "app/config/config.h" #include "app/config/config.h"
#include "feature/relay/router.h" #include "feature/relay/router.h"
#include "feature/relay/routerkeys.h" #include "feature/relay/routerkeys.h"
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/crypt_ops/crypto_format.h" #include "lib/crypt_ops/crypto_format.h"
#include "feature/nodelist/torcert.h" #include "feature/nodelist/torcert.h"
#include "test/test.h" #include "test/test.h"

View File

@ -6,7 +6,7 @@
#include "orconfig.h" #include "orconfig.h"
#define UTIL_PRIVATE #define UTIL_PRIVATE
#define SUBPROCESS_PRIVATE #define SUBPROCESS_PRIVATE
#include "lib/crypt_ops/crypto.h" #include "lib/crypt_ops/crypto_cipher.h"
#include "lib/log/log.h" #include "lib/log/log.h"
#include "lib/process/subprocess.h" #include "lib/process/subprocess.h"
#include "lib/process/waitpid.h" #include "lib/process/waitpid.h"

View File

@ -33,9 +33,9 @@ ENABLE_GCC_WARNING(redundant-decls)
#include <errno.h> #include <errno.h>
#include "lib/crypt_ops/crypto.h"
#include "lib/crypt_ops/crypto_digest.h" #include "lib/crypt_ops/crypto_digest.h"
#include "lib/crypt_ops/crypto_rand.h" #include "lib/crypt_ops/crypto_rand.h"
#include "lib/crypt_ops/crypto_rsa.h"
#include "lib/crypt_ops/crypto_util.h" #include "lib/crypt_ops/crypto_util.h"
#include "lib/encoding/binascii.h" #include "lib/encoding/binascii.h"
#include "lib/encoding/time_fmt.h" #include "lib/encoding/time_fmt.h"