aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-10-27 18:55:44 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-10-27 18:55:44 +0100
commitccc9d0065dfecdac39ae26c5e3f824102131a0c8 (patch)
tree276eb42bf4a38f2b72a5c46d1b88bc77c8c39f02 /src/libcryptobox
parent649f9aa4a32fc51c1b60b28fa8830a603c88fcad (diff)
downloadrspamd-ccc9d0065dfecdac39ae26c5e3f824102131a0c8.tar.gz
rspamd-ccc9d0065dfecdac39ae26c5e3f824102131a0c8.zip
[Minor] Convert some enums to static macros
Diffstat (limited to 'src/libcryptobox')
-rw-r--r--src/libcryptobox/blake2/blake2.h14
-rw-r--r--src/libcryptobox/chacha20/chacha.h5
-rw-r--r--src/libcryptobox/poly1305/ref-64.c5
3 files changed, 11 insertions, 13 deletions
diff --git a/src/libcryptobox/blake2/blake2.h b/src/libcryptobox/blake2/blake2.h
index 9966c66d2..3da1958ae 100644
--- a/src/libcryptobox/blake2/blake2.h
+++ b/src/libcryptobox/blake2/blake2.h
@@ -20,13 +20,13 @@
extern "C" {
#endif
-enum blake2b_constant {
- BLAKE2B_BLOCKBYTES = 128,
- BLAKE2B_OUTBYTES = 64,
- BLAKE2B_KEYBYTES = 64,
- BLAKE2B_SALTBYTES = 16,
- BLAKE2B_PERSONALBYTES = 16
-};
+
+#define BLAKE2B_BLOCKBYTES 128
+#define BLAKE2B_OUTBYTES 64
+#define BLAKE2B_KEYBYTES 64
+#define BLAKE2B_SALTBYTES 16
+#define BLAKE2B_PERSONALBYTES 16
+
typedef struct blake2b_state_t {
unsigned char opaque[256];
diff --git a/src/libcryptobox/chacha20/chacha.h b/src/libcryptobox/chacha20/chacha.h
index f69a63db9..7f93a4517 100644
--- a/src/libcryptobox/chacha20/chacha.h
+++ b/src/libcryptobox/chacha20/chacha.h
@@ -26,9 +26,8 @@
#ifndef CHACHA_H_
#define CHACHA_H_
-enum chacha_constants {
- CHACHA_BLOCKBYTES = 64,
-};
+
+#define CHACHA_BLOCKBYTES 64
typedef struct chacha_state_internal_t {
unsigned char s[48];
diff --git a/src/libcryptobox/poly1305/ref-64.c b/src/libcryptobox/poly1305/ref-64.c
index 48d5fbcc6..cceb1476d 100644
--- a/src/libcryptobox/poly1305/ref-64.c
+++ b/src/libcryptobox/poly1305/ref-64.c
@@ -7,9 +7,8 @@
#include "config.h"
#include "poly1305.h"
#include "poly1305_internal.h"
-enum {
- POLY1305_BLOCK_SIZE = 16
-};
+
+#define POLY1305_BLOCK_SIZE 16
typedef struct poly1305_state_ref_t {
uint64_t r[3];