Make functions static that are only accessed from the same compilation unit

Also removed some declarations for undefined functions.
This commit is contained in:
Tobias Brunner
2022-10-05 19:00:46 +02:00
parent c58ba0cb9f
commit 7f46c76125
23 changed files with 29 additions and 70 deletions
+3 -3
View File
@@ -305,10 +305,10 @@ METHOD(mac_t, destroy, void,
free_align(this);
}
/*
* Described in header
/**
* Create a generic mac_t object using AESNI CMAC
*/
mac_t *aesni_cmac_create(encryption_algorithm_t algo, size_t key_size)
static mac_t *aesni_cmac_create(encryption_algorithm_t algo, size_t key_size)
{
private_mac_t *this;
@@ -26,14 +26,6 @@
#include <crypto/prfs/prf.h>
#include <crypto/signers/signer.h>
/**
* Create a generic mac_t object using AESNI CMAC.
*
* @param algo underlying encryption algorithm
* @param key_size size of encryption key, in bytes
*/
mac_t *aesni_cmac_create(encryption_algorithm_t algo, size_t key_size);
/**
* Creates a new prf_t object based AESNI CMAC.
*
+3 -3
View File
@@ -301,10 +301,10 @@ METHOD(mac_t, destroy, void,
free_align(this);
}
/*
* Described in header
/**
* Create a generic mac_t object using AESNI XCBC
*/
mac_t *aesni_xcbc_create(encryption_algorithm_t algo, size_t key_size)
static mac_t *aesni_xcbc_create(encryption_algorithm_t algo, size_t key_size)
{
private_aesni_mac_t *this;
@@ -26,14 +26,6 @@
#include <crypto/prfs/prf.h>
#include <crypto/signers/signer.h>
/**
* Create a generic mac_t object using AESNI XCBC
*
* @param algo underlying encryption algorithm
* @param key_size size of encryption key, in bytes
*/
mac_t *aesni_xcbc_create(encryption_algorithm_t algo, size_t key_size);
/**
* Creates a new prf_t object based AESNI XCBC.
*
@@ -80,7 +80,7 @@ struct private_botan_diffie_hellman_t {
/**
* Load a DH private key
*/
bool load_private_key(private_botan_diffie_hellman_t *this, chunk_t value)
static bool load_private_key(private_botan_diffie_hellman_t *this, chunk_t value)
{
botan_mp_t xa;
+3 -3
View File
@@ -310,10 +310,10 @@ METHOD(mac_t, destroy, void,
free(this);
}
/*
* Described in header
/**
* Create a generic mac_t object
*/
mac_t *cmac_create(encryption_algorithm_t algo, size_t key_size)
static mac_t *cmac_create(encryption_algorithm_t algo, size_t key_size)
{
private_mac_t *this;
crypter_t *crypter;
@@ -531,13 +531,6 @@ YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!
PERM_OP(l,r,tt, 4,0x0f0f0f0fL); \
}
#ifndef NOPROTO
void fcrypt_body(DES_LONG *out,des_key_schedule ks,
DES_LONG Eswap0, DES_LONG Eswap1);
#else
void fcrypt_body();
#endif
static const DES_LONG des_skb[8][64]={
{ /* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
0x00000000L,0x00000010L,0x20000000L,0x20000010L,
@@ -73,17 +73,4 @@ openssl_rsa_private_key_t *openssl_rsa_private_key_load(key_type_t type,
*/
private_key_t *openssl_rsa_private_key_create(EVP_PKEY *key, bool engine);
/**
* Connect to a RSA private key on a smartcard.
*
* Accepts the BUILD_SMARTCARD_KEYID and the BUILD_SMARTCARD_PIN
* arguments.
*
* @param type type of the key, must be KEY_RSA
* @param args builder_part_t argument list
* @return loaded key, NULL on failure
*/
openssl_rsa_private_key_t *openssl_rsa_private_key_connect(key_type_t type,
va_list args);
#endif /** OPENSSL_RSA_PRIVATE_KEY_H_ @}*/
@@ -105,7 +105,7 @@ typedef struct {
/**
* Destroy a signerinfo_t entry
*/
void signerinfo_destroy(signerinfo_t *this)
static void signerinfo_destroy(signerinfo_t *this)
{
DESTROY_IF(this->attributes);
DESTROY_IF(this->serial);
+1 -1
View File
@@ -2041,7 +2041,7 @@ static private_x509_cert_t* create_empty(void)
/**
* Build a generalName from an id
*/
chunk_t build_generalName(identification_t *id)
static chunk_t build_generalName(identification_t *id)
{
int context;