summaryrefslogtreecommitdiffstats
path: root/crypto/poly1305/poly1305.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2015-12-19 14:16:47 +0100
committerAndy Polyakov <appro@openssl.org>2016-02-10 10:31:18 +0100
commite87c056745845ecaa6a884fa9cf0dc0c404f0c46 (patch)
tree4e997d4308cdade9286cab4b67a9e10912d06651 /crypto/poly1305/poly1305.c
parenta98c648e40ea5158c8ba29b5a70ccc239d426a20 (diff)
poly1305/poly1305.c: work around -Wshadow warnings with POLY1305_ASM.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/poly1305/poly1305.c')
-rw-r--r--crypto/poly1305/poly1305.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/crypto/poly1305/poly1305.c b/crypto/poly1305/poly1305.c
index 9a44f27f04..7c9f302bfc 100644
--- a/crypto/poly1305/poly1305.c
+++ b/crypto/poly1305/poly1305.c
@@ -454,6 +454,15 @@ void Poly1305_Init(POLY1305 *ctx, const unsigned char key[32])
}
+#ifdef POLY1305_ASM
+/*
+ * This "eclipses" poly1305_blocks and poly1305_emit, but it's
+ * conscious choice imposed by -Wshadow compiler warnings.
+ */
+# define poly1305_blocks (*poly1305_blocks_p)
+# define poly1305_emit (*poly1305_emit_p)
+#endif
+
void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len)
{
#ifdef POLY1305_ASM
@@ -463,7 +472,7 @@ void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len)
* property is fluently used in assembly modules to optimize
* padbit handling on loop boundary.
*/
- poly1305_blocks_f poly1305_blocks = ctx->func.blocks;
+ poly1305_blocks_f poly1305_blocks_p = ctx->func.blocks;
#endif
size_t rem, num;
@@ -499,8 +508,8 @@ void Poly1305_Update(POLY1305 *ctx, const unsigned char *inp, size_t len)
void Poly1305_Final(POLY1305 *ctx, unsigned char mac[16])
{
#ifdef POLY1305_ASM
- poly1305_blocks_f poly1305_blocks = ctx->func.blocks;
- poly1305_emit_f poly1305_emit = ctx->func.emit;
+ poly1305_blocks_f poly1305_blocks_p = ctx->func.blocks;
+ poly1305_emit_f poly1305_emit_p = ctx->func.emit;
#endif
size_t num;