aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRené van Dorst <opensource@vdorst.com>2018-05-30 11:13:19 +0200
committerRené van Dorst <opensource@vdorst.com>2018-05-30 20:00:57 +0200
commit2e86e364238f07ba49729fc4ad2351e4cfc0240b (patch)
tree55a87cf4c76fbcbfccdbf8de59abcfed78aa0c6f
parentpoly1305: mips: compute S on fly (diff)
downloadwireguard-monolithic-historical-2e86e364238f07ba49729fc4ad2351e4cfc0240b.tar.xz
wireguard-monolithic-historical-2e86e364238f07ba49729fc4ad2351e4cfc0240b.zip
Set POLY1305_OPAQUE_LEN at compiletime.
Signed-off-by: René van Dorst <opensource@vdorst.com>
-rw-r--r--src/crypto/poly1305.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/crypto/poly1305.h b/src/crypto/poly1305.h
index 876234c..7311d46 100644
--- a/src/crypto/poly1305.h
+++ b/src/crypto/poly1305.h
@@ -14,8 +14,14 @@ enum poly1305_lengths {
POLY1305_MAC_SIZE = 16
};
+
+#if !defined(POLY1305_OPAQUE_LEN)
+/* Default POLY1305_OPAQUE_LEN, can be removed when all lengths are known. */
+#define POLY1305_OPAQUE_LEN (24 * sizeof(u64))
+#endif
+
struct poly1305_ctx {
- u8 opaque[24 * sizeof(u64)];
+ u8 opaque[POLY1305_OPAQUE_LEN];
u32 nonce[4];
u8 data[POLY1305_BLOCK_SIZE];
size_t num;