Skip to content

Commit

Permalink
Update style.
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Ashley <[email protected]>
  • Loading branch information
ashman-p committed Oct 23, 2024
1 parent 45081bb commit 57e21ad
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
54 changes: 27 additions & 27 deletions src/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,39 +170,39 @@ extern "C" {
*
*/
typedef enum {
/** Used to indicate that some undefined error occurred. */
OQS_ERROR = -1,
/** Used to indicate successful return from function. */
OQS_SUCCESS = 0,
/** Used to indicate failures in external libraries (e.g., OpenSSL). */
OQS_EXTERNAL_LIB_ERROR_OPENSSL = 50,
/** Used to indicate that some undefined error occurred. */
OQS_ERROR = -1,
/** Used to indicate successful return from function. */
OQS_SUCCESS = 0,
/** Used to indicate failures in external libraries (e.g., OpenSSL). */
OQS_EXTERNAL_LIB_ERROR_OPENSSL = 50,
} OQS_STATUS;

/**
* CPU runtime detection flags
*/
typedef enum {
OQS_CPU_EXT_INIT, /* Must be first */
/* Start extension list */
OQS_CPU_EXT_ADX,
OQS_CPU_EXT_AES,
OQS_CPU_EXT_AVX,
OQS_CPU_EXT_AVX2,
OQS_CPU_EXT_AVX512,
OQS_CPU_EXT_BMI1,
OQS_CPU_EXT_BMI2,
OQS_CPU_EXT_PCLMULQDQ,
OQS_CPU_EXT_VPCLMULQDQ,
OQS_CPU_EXT_POPCNT,
OQS_CPU_EXT_SSE,
OQS_CPU_EXT_SSE2,
OQS_CPU_EXT_SSE3,
OQS_CPU_EXT_ARM_AES,
OQS_CPU_EXT_ARM_SHA2,
OQS_CPU_EXT_ARM_SHA3,
OQS_CPU_EXT_ARM_NEON,
/* End extension list */
OQS_CPU_EXT_COUNT, /* Must be last */
OQS_CPU_EXT_INIT, /* Must be first */
/* Start extension list */
OQS_CPU_EXT_ADX,
OQS_CPU_EXT_AES,
OQS_CPU_EXT_AVX,
OQS_CPU_EXT_AVX2,
OQS_CPU_EXT_AVX512,
OQS_CPU_EXT_BMI1,
OQS_CPU_EXT_BMI2,
OQS_CPU_EXT_PCLMULQDQ,
OQS_CPU_EXT_VPCLMULQDQ,
OQS_CPU_EXT_POPCNT,
OQS_CPU_EXT_SSE,
OQS_CPU_EXT_SSE2,
OQS_CPU_EXT_SSE3,
OQS_CPU_EXT_ARM_AES,
OQS_CPU_EXT_ARM_SHA2,
OQS_CPU_EXT_ARM_SHA3,
OQS_CPU_EXT_ARM_NEON,
/* End extension list */
OQS_CPU_EXT_COUNT, /* Must be last */
} OQS_CPU_EXT;

/**
Expand Down
34 changes: 17 additions & 17 deletions src/common/ossl_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,46 +6,46 @@
// code by definining the FUNC macro, so no header guard should be
// added here.

VOID_FUNC(void, ERR_print_errors_fp, (FILE * fp), (fp))
VOID_FUNC(void, EVP_CIPHER_CTX_free, (EVP_CIPHER_CTX * c), (c))
VOID_FUNC(void, ERR_print_errors_fp, (FILE *fp), (fp))
VOID_FUNC(void, EVP_CIPHER_CTX_free, (EVP_CIPHER_CTX *c), (c))
FUNC(EVP_CIPHER_CTX *, EVP_CIPHER_CTX_new, (void), ())
FUNC(int, EVP_CIPHER_CTX_set_padding, (EVP_CIPHER_CTX * c, int pad), (c, pad))
FUNC(int, EVP_DigestFinalXOF, (EVP_MD_CTX * ctx, unsigned char *md, size_t len),
FUNC(int, EVP_CIPHER_CTX_set_padding, (EVP_CIPHER_CTX *c, int pad), (c, pad))
FUNC(int, EVP_DigestFinalXOF, (EVP_MD_CTX *ctx, unsigned char *md, size_t len),
(ctx, md, len))
FUNC(int, EVP_DigestFinal_ex,
(EVP_MD_CTX * ctx, unsigned char *md, unsigned int *s), (ctx, md, s))
(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s), (ctx, md, s))
FUNC(int, EVP_DigestInit_ex,
(EVP_MD_CTX * ctx, const EVP_MD *type, ENGINE *impl), (ctx, type, impl))
FUNC(int, EVP_DigestUpdate, (EVP_MD_CTX * ctx, const void *d, size_t cnt),
(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl), (ctx, type, impl))
FUNC(int, EVP_DigestUpdate, (EVP_MD_CTX *ctx, const void *d, size_t cnt),
(ctx, d, cnt))
FUNC(int, EVP_EncryptFinal_ex,
(EVP_CIPHER_CTX * ctx, unsigned char *out, int *outl), (ctx, out, outl))
(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl), (ctx, out, outl))
FUNC(int, EVP_EncryptInit_ex,
(EVP_CIPHER_CTX * ctx, const EVP_CIPHER *cipher, ENGINE *impl,
(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *impl,
const unsigned char *key, const unsigned char *iv),
(ctx, cipher, impl, key, iv))
FUNC(int, EVP_EncryptUpdate,
(EVP_CIPHER_CTX * ctx, unsigned char *out, int *outl,
(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
const unsigned char *in, int inl),
(ctx, out, outl, in, inl))
FUNC(int, EVP_MD_CTX_copy_ex, (EVP_MD_CTX * out, const EVP_MD_CTX *in),
FUNC(int, EVP_MD_CTX_copy_ex, (EVP_MD_CTX *out, const EVP_MD_CTX *in),
(out, in))
VOID_FUNC(void, EVP_MD_CTX_free, (EVP_MD_CTX * ctx), (ctx))
VOID_FUNC(void, EVP_MD_CTX_free, (EVP_MD_CTX *ctx), (ctx))
FUNC(EVP_MD_CTX *, EVP_MD_CTX_new, (void), ())
FUNC(int, EVP_MD_CTX_reset, (EVP_MD_CTX * ctx), (ctx))
FUNC(int, EVP_MD_CTX_reset, (EVP_MD_CTX *ctx), (ctx))
FUNC(const EVP_CIPHER *, EVP_aes_128_ecb, (void), ())
FUNC(const EVP_CIPHER *, EVP_aes_128_ctr, (void), ())
FUNC(const EVP_CIPHER *, EVP_aes_256_ecb, (void), ())
FUNC(const EVP_CIPHER *, EVP_aes_256_ctr, (void), ())
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
FUNC(EVP_CIPHER *, EVP_CIPHER_fetch,
(OSSL_LIB_CTX * ctx, const char *algorithm, const char *properties),
(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties),
(ctx, algorithm, properties))
VOID_FUNC(void, EVP_CIPHER_free, (EVP_CIPHER * cipher), (cipher))
VOID_FUNC(void, EVP_CIPHER_free, (EVP_CIPHER *cipher), (cipher))
FUNC(EVP_MD *, EVP_MD_fetch,
(OSSL_LIB_CTX * ctx, const char *algorithm, const char *properties),
(OSSL_LIB_CTX *ctx, const char *algorithm, const char *properties),
(ctx, algorithm, properties))
VOID_FUNC(void, EVP_MD_free, (EVP_MD * md), (md))
VOID_FUNC(void, EVP_MD_free, (EVP_MD *md), (md))
#else
FUNC(const EVP_MD *, EVP_sha256, (void), ())
FUNC(const EVP_MD *, EVP_sha384, (void), ())
Expand Down

0 comments on commit 57e21ad

Please sign in to comment.