summaryrefslogtreecommitdiff
path: root/lib/algorithms.h
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2023-04-24 12:39:42 +0900
committerDaiki Ueno <ueno@gnu.org>2023-04-24 12:45:46 +0900
commitaa5950abab56b011331ad4331409b6ff8efb8aeb (patch)
treead363fb38e8b65c942876641cda9c76caa13b498 /lib/algorithms.h
parent0fe9cb6842d63761718046cc7dd7eb437e6c5163 (diff)
downloadgnutls-aa5950abab56b011331ad4331409b6ff8efb8aeb.tar.gz
build: re-indent code
Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'lib/algorithms.h')
-rw-r--r--lib/algorithms.h251
1 files changed, 127 insertions, 124 deletions
diff --git a/lib/algorithms.h b/lib/algorithms.h
index 727bc5c9f9..c59dc87b8b 100644
--- a/lib/algorithms.h
+++ b/lib/algorithms.h
@@ -22,41 +22,45 @@
*/
#ifndef GNUTLS_LIB_ALGORITHMS_H
-# define GNUTLS_LIB_ALGORITHMS_H
+#define GNUTLS_LIB_ALGORITHMS_H
-# include "auth.h"
+#include "auth.h"
-# ifdef DISABLE_SYSTEM_CONFIG
-# define SYSTEM_CONFIG_OR_CONST const
-# else
-# define SYSTEM_CONFIG_OR_CONST
-# endif
+#ifdef DISABLE_SYSTEM_CONFIG
+#define SYSTEM_CONFIG_OR_CONST const
+#else
+#define SYSTEM_CONFIG_OR_CONST
+#endif
-# define version_to_entry _gnutls_version_to_entry
+#define version_to_entry _gnutls_version_to_entry
-# define GNUTLS_RENEGO_PROTECTION_REQUEST_MAJOR 0x00
-# define GNUTLS_RENEGO_PROTECTION_REQUEST_MINOR 0xFF
+#define GNUTLS_RENEGO_PROTECTION_REQUEST_MAJOR 0x00
+#define GNUTLS_RENEGO_PROTECTION_REQUEST_MINOR 0xFF
-# define GNUTLS_FALLBACK_SCSV_MAJOR 0x56
-# define GNUTLS_FALLBACK_SCSV_MINOR 0x00
+#define GNUTLS_FALLBACK_SCSV_MAJOR 0x56
+#define GNUTLS_FALLBACK_SCSV_MINOR 0x00
-# define IS_GOSTEC(x) (((x)==GNUTLS_PK_GOST_01) || \
- ((x)==GNUTLS_PK_GOST_12_256)|| \
- ((x)==GNUTLS_PK_GOST_12_512))
+#define IS_GOSTEC(x) \
+ (((x) == GNUTLS_PK_GOST_01) || ((x) == GNUTLS_PK_GOST_12_256) || \
+ ((x) == GNUTLS_PK_GOST_12_512))
-# define IS_EC(x) (((x)==GNUTLS_PK_ECDSA)|| \
- ((x)==GNUTLS_PK_ECDH_X25519)||((x)==GNUTLS_PK_EDDSA_ED25519)|| \
- ((x)==GNUTLS_PK_ECDH_X448)||((x)==GNUTLS_PK_EDDSA_ED448))
+#define IS_EC(x) \
+ (((x) == GNUTLS_PK_ECDSA) || ((x) == GNUTLS_PK_ECDH_X25519) || \
+ ((x) == GNUTLS_PK_EDDSA_ED25519) || ((x) == GNUTLS_PK_ECDH_X448) || \
+ ((x) == GNUTLS_PK_EDDSA_ED448))
-# define SIG_SEM_PRE_TLS12 (1<<1)
-# define SIG_SEM_TLS13 (1<<2)
-# define SIG_SEM_DEFAULT (SIG_SEM_PRE_TLS12|SIG_SEM_TLS13)
+#define SIG_SEM_PRE_TLS12 (1 << 1)
+#define SIG_SEM_TLS13 (1 << 2)
+#define SIG_SEM_DEFAULT (SIG_SEM_PRE_TLS12 | SIG_SEM_TLS13)
-# define TLS_SIGN_AID_UNKNOWN {{255, 255}, 0}
-# define HAVE_UNKNOWN_SIGAID(aid) ((aid)->id[0] == 255 && (aid)->id[1] == 255)
+#define TLS_SIGN_AID_UNKNOWN \
+ { \
+ { 255, 255 }, 0 \
+ }
+#define HAVE_UNKNOWN_SIGAID(aid) ((aid)->id[0] == 255 && (aid)->id[1] == 255)
-# define CS_INVALID_MAJOR 0x00
-# define CS_INVALID_MINOR 0x00
+#define CS_INVALID_MAJOR 0x00
+#define CS_INVALID_MINOR 0x00
/* Functions for version handling. */
const version_entry_st *version_to_entry(gnutls_protocol_t version);
@@ -67,23 +71,22 @@ const version_entry_st *_gnutls_legacy_version_max(gnutls_session_t session);
const version_entry_st *_gnutls_version_max(gnutls_session_t session);
int _gnutls_version_priority(gnutls_session_t session,
gnutls_protocol_t version);
-int _gnutls_nversion_is_supported(gnutls_session_t session,
- unsigned char major, unsigned char minor);
+int _gnutls_nversion_is_supported(gnutls_session_t session, unsigned char major,
+ unsigned char minor);
gnutls_protocol_t _gnutls_version_get(uint8_t major, uint8_t minor);
unsigned _gnutls_version_is_too_high(gnutls_session_t session, uint8_t major,
uint8_t minor);
-int _gnutls_write_supported_versions(gnutls_session_t session, uint8_t * buffer,
+int _gnutls_write_supported_versions(gnutls_session_t session, uint8_t *buffer,
ssize_t buffer_size);
/* Functions for feature checks */
-int
-_gnutls_figure_common_ciphersuite(gnutls_session_t session,
- const ciphersuite_list_st * peer_clist,
- const gnutls_cipher_suite_entry_st ** ce);
+int _gnutls_figure_common_ciphersuite(gnutls_session_t session,
+ const ciphersuite_list_st *peer_clist,
+ const gnutls_cipher_suite_entry_st **ce);
inline static int
-_gnutls_version_has_selectable_prf(const version_entry_st * ver)
+_gnutls_version_has_selectable_prf(const version_entry_st *ver)
{
if (unlikely(ver == NULL))
return 0;
@@ -91,23 +94,21 @@ _gnutls_version_has_selectable_prf(const version_entry_st * ver)
}
inline static int
-_gnutls_version_has_selectable_sighash(const version_entry_st * ver)
+_gnutls_version_has_selectable_sighash(const version_entry_st *ver)
{
if (unlikely(ver == NULL))
return 0;
return ver->selectable_sighash;
}
-inline static
-int _gnutls_version_has_extensions(const version_entry_st * ver)
+inline static int _gnutls_version_has_extensions(const version_entry_st *ver)
{
if (unlikely(ver == NULL))
return 0;
return ver->extensions;
}
-inline static
-int _gnutls_version_has_explicit_iv(const version_entry_st * ver)
+inline static int _gnutls_version_has_explicit_iv(const version_entry_st *ver)
{
if (unlikely(ver == NULL))
return 0;
@@ -116,10 +117,10 @@ int _gnutls_version_has_explicit_iv(const version_entry_st * ver)
/* Functions for MACs. */
const mac_entry_st *_gnutls_mac_to_entry(gnutls_mac_algorithm_t c);
-# define mac_to_entry(x) _gnutls_mac_to_entry(x)
-# define hash_to_entry(x) mac_to_entry((gnutls_mac_algorithm_t)(x))
+#define mac_to_entry(x) _gnutls_mac_to_entry(x)
+#define hash_to_entry(x) mac_to_entry((gnutls_mac_algorithm_t)(x))
-inline static int _gnutls_mac_is_ok(const mac_entry_st * e)
+inline static int _gnutls_mac_is_ok(const mac_entry_st *e)
{
if (unlikely(e == NULL) || e->id == 0)
return 0;
@@ -136,7 +137,7 @@ inline static int _gnutls_mac_is_ok(const mac_entry_st * e)
* Returns: length (in bytes) of the MAC output size, or 0 if the
* given MAC algorithm is invalid.
-*/
-inline static size_t _gnutls_mac_get_algo_len(const mac_entry_st * e)
+inline static size_t _gnutls_mac_get_algo_len(const mac_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
@@ -144,7 +145,7 @@ inline static size_t _gnutls_mac_get_algo_len(const mac_entry_st * e)
return e->output_size;
}
-inline static const char *_gnutls_x509_mac_to_oid(const mac_entry_st * e)
+inline static const char *_gnutls_x509_mac_to_oid(const mac_entry_st *e)
{
if (unlikely(e == NULL))
return NULL;
@@ -152,7 +153,7 @@ inline static const char *_gnutls_x509_mac_to_oid(const mac_entry_st * e)
return e->oid;
}
-inline static const char *_gnutls_mac_get_name(const mac_entry_st * e)
+inline static const char *_gnutls_mac_get_name(const mac_entry_st *e)
{
if (unlikely(e == NULL))
return NULL;
@@ -160,7 +161,7 @@ inline static const char *_gnutls_mac_get_name(const mac_entry_st * e)
return e->name;
}
-inline static int _gnutls_mac_block_size(const mac_entry_st * e)
+inline static int _gnutls_mac_block_size(const mac_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
@@ -168,7 +169,7 @@ inline static int _gnutls_mac_block_size(const mac_entry_st * e)
return e->block_size;
}
-inline static int _gnutls_mac_get_key_size(const mac_entry_st * e)
+inline static int _gnutls_mac_get_key_size(const mac_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
@@ -182,20 +183,20 @@ _gnutls_mac_to_dig(gnutls_mac_algorithm_t mac)
if (unlikely(mac >= GNUTLS_MAC_AEAD))
return GNUTLS_DIG_UNKNOWN;
- return (gnutls_digest_algorithm_t) mac;
+ return (gnutls_digest_algorithm_t)mac;
}
-# define MAC_TO_DIG(mac) _gnutls_mac_to_dig(mac)
+#define MAC_TO_DIG(mac) _gnutls_mac_to_dig(mac)
/* Functions for digests. */
-# define _gnutls_x509_digest_to_oid _gnutls_x509_mac_to_oid
-# define _gnutls_digest_get_name _gnutls_mac_get_name
-# define _gnutls_hash_get_algo_len _gnutls_mac_get_algo_len
+#define _gnutls_x509_digest_to_oid _gnutls_x509_mac_to_oid
+#define _gnutls_digest_get_name _gnutls_mac_get_name
+#define _gnutls_hash_get_algo_len _gnutls_mac_get_algo_len
-# define DIG_TO_MAC(dig) (gnutls_mac_algorithm_t)(dig)
+#define DIG_TO_MAC(dig) (gnutls_mac_algorithm_t)(dig)
/* Security against pre-image attacks */
-inline static int _gnutls_digest_is_secure(const mac_entry_st * e)
+inline static int _gnutls_digest_is_secure(const mac_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
@@ -205,93 +206,92 @@ inline static int _gnutls_digest_is_secure(const mac_entry_st * e)
/* Functions for cipher suites. */
int _gnutls_get_client_ciphersuites(gnutls_session_t session,
- gnutls_buffer_st * cdata,
- const version_entry_st * minver,
+ gnutls_buffer_st *cdata,
+ const version_entry_st *minver,
unsigned add_scsv);
int _gnutls_supported_ciphersuites(gnutls_session_t session,
- uint8_t * cipher_suites,
+ uint8_t *cipher_suites,
unsigned int max_cipher_suite_size);
-const gnutls_cipher_suite_entry_st
- * cipher_suite_get(gnutls_kx_algorithm_t kx_algorithm,
- gnutls_cipher_algorithm_t cipher_algorithm,
- gnutls_mac_algorithm_t mac_algorithm);
+const gnutls_cipher_suite_entry_st *
+cipher_suite_get(gnutls_kx_algorithm_t kx_algorithm,
+ gnutls_cipher_algorithm_t cipher_algorithm,
+ gnutls_mac_algorithm_t mac_algorithm);
const char *_gnutls_cipher_suite_get_name(const uint8_t suite[2]);
gnutls_kx_algorithm_t _gnutls_cipher_suite_get_kx_algo(const uint8_t suite[2]);
-int
-_gnutls_cipher_suite_get_id(gnutls_kx_algorithm_t kx_algorithm,
- gnutls_cipher_algorithm_t cipher_algorithm,
- gnutls_mac_algorithm_t mac_algorithm,
- uint8_t suite[2]);
+int _gnutls_cipher_suite_get_id(gnutls_kx_algorithm_t kx_algorithm,
+ gnutls_cipher_algorithm_t cipher_algorithm,
+ gnutls_mac_algorithm_t mac_algorithm,
+ uint8_t suite[2]);
-const gnutls_cipher_suite_entry_st *ciphersuite_to_entry(const uint8_t
- suite[2]);
+const gnutls_cipher_suite_entry_st *
+ciphersuite_to_entry(const uint8_t suite[2]);
/* Functions for ciphers. */
const cipher_entry_st *_gnutls_cipher_to_entry(gnutls_cipher_algorithm_t c);
-# define cipher_to_entry(x) _gnutls_cipher_to_entry(x)
+#define cipher_to_entry(x) _gnutls_cipher_to_entry(x)
const cipher_entry_st *cipher_name_to_entry(const char *name);
-inline static cipher_type_t _gnutls_cipher_type(const cipher_entry_st * e)
+inline static cipher_type_t _gnutls_cipher_type(const cipher_entry_st *e)
{
if (unlikely(e == NULL))
- return CIPHER_AEAD; /* doesn't matter */
+ return CIPHER_AEAD; /* doesn't matter */
return e->type;
}
-inline static int _gnutls_cipher_get_block_size(const cipher_entry_st * e)
+inline static int _gnutls_cipher_get_block_size(const cipher_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
return e->blocksize;
}
-inline static int _gnutls_cipher_get_implicit_iv_size(const cipher_entry_st * e)
+inline static int _gnutls_cipher_get_implicit_iv_size(const cipher_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
return e->implicit_iv;
}
-inline static int _gnutls_cipher_get_iv_size(const cipher_entry_st * e)
+inline static int _gnutls_cipher_get_iv_size(const cipher_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
return e->cipher_iv;
}
-inline static int _gnutls_cipher_get_explicit_iv_size(const cipher_entry_st * e)
+inline static int _gnutls_cipher_get_explicit_iv_size(const cipher_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
return e->explicit_iv;
}
-inline static int _gnutls_cipher_get_key_size(const cipher_entry_st * e)
+inline static int _gnutls_cipher_get_key_size(const cipher_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
return e->keysize;
}
-inline static const char *_gnutls_cipher_get_name(const cipher_entry_st * e)
+inline static const char *_gnutls_cipher_get_name(const cipher_entry_st *e)
{
if (unlikely(e == NULL))
return NULL;
return e->name;
}
-inline static int _gnutls_cipher_algo_is_aead(const cipher_entry_st * e)
+inline static int _gnutls_cipher_algo_is_aead(const cipher_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
return (e->type == CIPHER_AEAD) ? 1 : 0;
}
-inline static int _gnutls_cipher_is_ok(const cipher_entry_st * e)
+inline static int _gnutls_cipher_is_ok(const cipher_entry_st *e)
{
if (unlikely(e == NULL) || e->id == 0)
return 0;
@@ -299,7 +299,7 @@ inline static int _gnutls_cipher_is_ok(const cipher_entry_st * e)
return 1;
}
-inline static int _gnutls_cipher_get_tag_size(const cipher_entry_st * e)
+inline static int _gnutls_cipher_get_tag_size(const cipher_entry_st *e)
{
size_t ret = 0;
@@ -318,20 +318,22 @@ int _gnutls_kx_is_ok(gnutls_kx_algorithm_t algorithm);
int _gnutls_kx_get_id(const char *name);
-gnutls_credentials_type_t _gnutls_map_kx_get_cred(gnutls_kx_algorithm_t
- algorithm, int server);
+gnutls_credentials_type_t
+_gnutls_map_kx_get_cred(gnutls_kx_algorithm_t algorithm, int server);
/* KX to PK mapping. */
-unsigned
-_gnutls_kx_supports_pk(gnutls_kx_algorithm_t kx_algorithm,
- gnutls_pk_algorithm_t pk_algorithm);
+unsigned _gnutls_kx_supports_pk(gnutls_kx_algorithm_t kx_algorithm,
+ gnutls_pk_algorithm_t pk_algorithm);
-unsigned
-_gnutls_kx_supports_pk_usage(gnutls_kx_algorithm_t kx_algorithm,
- gnutls_pk_algorithm_t pk_algorithm,
- unsigned key_usage);
+unsigned _gnutls_kx_supports_pk_usage(gnutls_kx_algorithm_t kx_algorithm,
+ gnutls_pk_algorithm_t pk_algorithm,
+ unsigned key_usage);
-enum encipher_type { CIPHER_ENCRYPT = 0, CIPHER_SIGN = 1, CIPHER_IGN };
+enum encipher_type {
+ CIPHER_ENCRYPT = 0,
+ CIPHER_SIGN = 1,
+ CIPHER_IGN
+};
enum encipher_type _gnutls_kx_encipher_type(gnutls_kx_algorithm_t kx_algorithm);
@@ -369,10 +371,11 @@ void _gnutls_version_mark_disabled_all(void);
void _gnutls_sign_mark_insecure_all(hash_security_level_t level);
void _gnutls_digest_mark_insecure_all(void);
-# define GNUTLS_SIGN_FLAG_TLS13_OK 1 /* if it is ok to use under TLS1.3 */
-# define GNUTLS_SIGN_FLAG_CRT_VRFY_REVERSE (1 << 1) /* reverse order of bytes in CrtVrfy signature */
-# define GNUTLS_SIGN_FLAG_INSECURE_REVERTIBLE (1 << 2)
-# define GNUTLS_SIGN_FLAG_ALLOW_INSECURE_REVERTIBLE (1 << 3)
+#define GNUTLS_SIGN_FLAG_TLS13_OK 1 /* if it is ok to use under TLS1.3 */
+#define GNUTLS_SIGN_FLAG_CRT_VRFY_REVERSE \
+ (1 << 1) /* reverse order of bytes in CrtVrfy signature */
+#define GNUTLS_SIGN_FLAG_INSECURE_REVERTIBLE (1 << 2)
+#define GNUTLS_SIGN_FLAG_ALLOW_INSECURE_REVERTIBLE (1 << 3)
struct gnutls_sign_entry_st {
const char *name;
const char *oid;
@@ -398,7 +401,8 @@ struct gnutls_sign_entry_st {
/* See RFC 5246 HashAlgorithm and SignatureAlgorithm
for values to use in aid struct. */
const sign_algorithm_st aid;
- hash_security_level_t slevel; /* contains values of hash_security_level_t */
+ hash_security_level_t
+ slevel; /* contains values of hash_security_level_t */
/* 0 if it matches the predefined hash output size, otherwise
* it is truncated or expanded (with XOF) */
@@ -407,15 +411,15 @@ struct gnutls_sign_entry_st {
typedef struct gnutls_sign_entry_st gnutls_sign_entry_st;
const gnutls_sign_entry_st *_gnutls_sign_to_entry(gnutls_sign_algorithm_t sign);
-const gnutls_sign_entry_st *_gnutls_pk_to_sign_entry(gnutls_pk_algorithm_t pk,
- gnutls_digest_algorithm_t
- hash);
+const gnutls_sign_entry_st *
+_gnutls_pk_to_sign_entry(gnutls_pk_algorithm_t pk,
+ gnutls_digest_algorithm_t hash);
const gnutls_sign_entry_st *_gnutls_oid_to_sign_entry(const char *oid);
/* returns true if that signature can be generated
* from the given private key algorithm. */
inline static unsigned
-sign_supports_priv_pk_algorithm(const gnutls_sign_entry_st * se,
+sign_supports_priv_pk_algorithm(const gnutls_sign_entry_st *se,
gnutls_pk_algorithm_t pk)
{
if (pk == se->pk || (se->priv_pk && se->priv_pk == pk))
@@ -427,34 +431,33 @@ sign_supports_priv_pk_algorithm(const gnutls_sign_entry_st * se,
/* returns true if that signature can be verified with
* the given public key algorithm. */
inline static unsigned
-sign_supports_cert_pk_algorithm(const gnutls_sign_entry_st * se,
+sign_supports_cert_pk_algorithm(const gnutls_sign_entry_st *se,
gnutls_pk_algorithm_t pk)
{
- if ((!se->cert_pk && pk == se->pk)
- || (se->cert_pk && se->cert_pk == pk))
+ if ((!se->cert_pk && pk == se->pk) ||
+ (se->cert_pk && se->cert_pk == pk))
return 1;
return 0;
}
-bool _gnutls_sign_is_secure2(const gnutls_sign_entry_st * se,
+bool _gnutls_sign_is_secure2(const gnutls_sign_entry_st *se,
unsigned int flags);
gnutls_pk_algorithm_t _gnutls_x509_sign_to_pk(gnutls_sign_algorithm_t sign);
const char *_gnutls_x509_sign_to_oid(gnutls_pk_algorithm_t,
gnutls_digest_algorithm_t mac);
-const gnutls_sign_entry_st *_gnutls_tls_aid_to_sign_entry(uint8_t id0,
- uint8_t id1,
- const version_entry_st
- * ver);
+const gnutls_sign_entry_st *
+_gnutls_tls_aid_to_sign_entry(uint8_t id0, uint8_t id1,
+ const version_entry_st *ver);
-gnutls_sign_algorithm_t
-_gnutls_tls_aid_to_sign(uint8_t id0, uint8_t id1, const version_entry_st * ver);
+gnutls_sign_algorithm_t _gnutls_tls_aid_to_sign(uint8_t id0, uint8_t id1,
+ const version_entry_st *ver);
const sign_algorithm_st *_gnutls_sign_to_tls_aid(gnutls_sign_algorithm_t sign);
-const gnutls_sign_entry_st
- * _gnutls13_sign_get_compatible_with_privkey(gnutls_privkey_t privkey);
+const gnutls_sign_entry_st *
+_gnutls13_sign_get_compatible_with_privkey(gnutls_privkey_t privkey);
unsigned int _gnutls_pk_bits_to_subgroup_bits(unsigned int pk_bits);
gnutls_digest_algorithm_t _gnutls_pk_bits_to_sha_hash(unsigned int pk_bits);
@@ -469,16 +472,16 @@ typedef struct gnutls_ecc_curve_entry_st {
const char *oid;
gnutls_ecc_curve_t id;
gnutls_pk_algorithm_t pk;
- unsigned size; /* the size in bytes */
- unsigned sig_size; /* the size of curve signatures in bytes (EdDSA) */
+ unsigned size; /* the size in bytes */
+ unsigned sig_size; /* the size of curve signatures in bytes (EdDSA) */
unsigned gost_curve;
bool supported;
bool supported_revertible;
gnutls_group_t group;
} gnutls_ecc_curve_entry_st;
-const gnutls_ecc_curve_entry_st
- * _gnutls_ecc_curve_get_params(gnutls_ecc_curve_t curve);
+const gnutls_ecc_curve_entry_st *
+_gnutls_ecc_curve_get_params(gnutls_ecc_curve_t curve);
unsigned _gnutls_ecc_curve_is_supported(gnutls_ecc_curve_t);
@@ -489,12 +492,12 @@ gnutls_group_t _gnutls_group_get_id(const char *name);
gnutls_ecc_curve_t _gnutls_ecc_bits_to_curve(gnutls_pk_algorithm_t pk,
int bits);
-# define MAX_ECC_CURVE_SIZE 66
+#define MAX_ECC_CURVE_SIZE 66
gnutls_pk_algorithm_t _gnutls_oid_to_pk_and_curve(const char *oid,
- gnutls_ecc_curve_t * curve);
+ gnutls_ecc_curve_t *curve);
-inline static int _curve_is_eddsa(const gnutls_ecc_curve_entry_st * e)
+inline static int _curve_is_eddsa(const gnutls_ecc_curve_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
@@ -503,7 +506,7 @@ inline static int _curve_is_eddsa(const gnutls_ecc_curve_entry_st * e)
return 0;
}
-inline static int _curve_is_modern_ecdh(const gnutls_ecc_curve_entry_st * e)
+inline static int _curve_is_modern_ecdh(const gnutls_ecc_curve_entry_st *e)
{
if (unlikely(e == NULL))
return 0;
@@ -559,19 +562,19 @@ static inline unsigned _gnutls_kx_is_vko_gost(gnutls_kx_algorithm_t kx)
return 0;
}
-static inline bool _sign_is_gost(const gnutls_sign_entry_st * se)
+static inline bool _sign_is_gost(const gnutls_sign_entry_st *se)
{
gnutls_pk_algorithm_t pk = se->pk;
- return (pk == GNUTLS_PK_GOST_01) ||
- (pk == GNUTLS_PK_GOST_12_256) || (pk == GNUTLS_PK_GOST_12_512);
+ return (pk == GNUTLS_PK_GOST_01) || (pk == GNUTLS_PK_GOST_12_256) ||
+ (pk == GNUTLS_PK_GOST_12_512);
}
static inline int _sig_is_ecdsa(gnutls_sign_algorithm_t sig)
{
if (sig == GNUTLS_SIGN_ECDSA_SHA1 || sig == GNUTLS_SIGN_ECDSA_SHA224 ||
- sig == GNUTLS_SIGN_ECDSA_SHA256 || sig == GNUTLS_SIGN_ECDSA_SHA384
- || sig == GNUTLS_SIGN_ECDSA_SHA512)
+ sig == GNUTLS_SIGN_ECDSA_SHA256 ||
+ sig == GNUTLS_SIGN_ECDSA_SHA384 || sig == GNUTLS_SIGN_ECDSA_SHA512)
return 1;
return 0;
@@ -582,4 +585,4 @@ bool _gnutls_pk_are_compat(gnutls_pk_algorithm_t pk1,
unsigned _gnutls_sign_get_hash_strength(gnutls_sign_algorithm_t sign);
-#endif /* GNUTLS_LIB_ALGORITHMS_H */
+#endif /* GNUTLS_LIB_ALGORITHMS_H */