From 93dee89a4a3f2ed0f70440aac46d3fa6cb676e5d Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sun, 15 Sep 2013 15:09:01 +0200 Subject: [PATCH] algos_enc: do not collide with library min() macro --- src/algos_enc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/algos_enc.cpp b/src/algos_enc.cpp index bbaa85d..8e96ba9 100644 --- a/src/algos_enc.cpp +++ b/src/algos_enc.cpp @@ -218,7 +218,7 @@ static bool message_unpad (std::vector in, bvector&out) * Fujisaki-okamoto part */ -#define min(a,b) ((a)<(b)?(a):(b)) +#define MIN(a,b) ((a)<(b)?(a):(b)) #include "sha_hash.h" #include "arcfour.h" @@ -292,7 +292,7 @@ static int fo_encrypt (const bvector&plain, bvector&cipher, //whole key must be tossed in, so split if when necessary for (i = 0; i < (K.size() >> 8); ++i) { std::vector subkey (K.begin() + (i << 8), - min (K.end(), + MIN (K.end(), K.begin() + ( (i + 1) << 8) ) ); arc.load_key (subkey); } @@ -357,7 +357,7 @@ static int fo_decrypt (const bvector&cipher, bvector&plain, //stuff in the whole key for (i = 0; i < (K.size() >> 8); ++i) { std::vector subkey (K.begin() + (i << 8), - min (K.end(), + MIN (K.end(), K.begin() + ( (i + 1) << 8) ) ); arc.load_key (subkey); }