Remove BITMASK macro

This commit is contained in:
John M. Schanck 2020-09-09 16:52:51 -04:00 committed by Kris Kwiatkowski
parent 1325ba6dff
commit 6cf952a2ce
24 changed files with 24 additions and 42 deletions

View File

@ -10,8 +10,7 @@
#include "vector.h" #include "vector.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -116,7 +116,7 @@ void PQCLEAN_HQC128_AVX2_vect_set_random(AES_XOF_struct *ctx, uint64_t *v) {
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }

View File

@ -10,8 +10,7 @@
#include "vector.h" #include "vector.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -148,7 +148,7 @@ void PQCLEAN_HQC128_CLEAN_vect_set_random(AES_XOF_struct *ctx, uint64_t *v) {
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }

View File

@ -10,8 +10,7 @@
#include "vector.h" #include "vector.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -116,7 +116,7 @@ void PQCLEAN_HQC192_AVX2_vect_set_random(AES_XOF_struct *ctx, uint64_t *v) {
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }

View File

@ -10,8 +10,7 @@
#include "vector.h" #include "vector.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -148,7 +148,7 @@ void PQCLEAN_HQC192_CLEAN_vect_set_random(AES_XOF_struct *ctx, uint64_t *v) {
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }

View File

@ -10,8 +10,7 @@
#include "vector.h" #include "vector.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -116,7 +116,7 @@ void PQCLEAN_HQC256_AVX2_vect_set_random(AES_XOF_struct *ctx, uint64_t *v) {
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }

View File

@ -10,8 +10,7 @@
#include "vector.h" #include "vector.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -148,7 +148,7 @@ void PQCLEAN_HQC256_CLEAN_vect_set_random(AES_XOF_struct *ctx, uint64_t *v) {
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }

View File

@ -11,9 +11,7 @@
#include "api.h" #include "api.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -116,7 +116,7 @@ void PQCLEAN_HQCRMRS128_AVX2_vect_set_random(AES_XOF_struct *ctx, uint64_t *v) {
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }

View File

@ -11,9 +11,7 @@
#include "api.h" #include "api.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -148,7 +148,7 @@ void PQCLEAN_HQCRMRS128_CLEAN_vect_set_random(AES_XOF_struct *ctx, uint64_t *v)
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }

View File

@ -11,9 +11,7 @@
#include "api.h" #include "api.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -116,7 +116,7 @@ void PQCLEAN_HQCRMRS192_AVX2_vect_set_random(AES_XOF_struct *ctx, uint64_t *v) {
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }

View File

@ -11,9 +11,7 @@
#include "api.h" #include "api.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -148,7 +148,7 @@ void PQCLEAN_HQCRMRS192_CLEAN_vect_set_random(AES_XOF_struct *ctx, uint64_t *v)
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }

View File

@ -11,9 +11,7 @@
#include "api.h" #include "api.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -116,7 +116,7 @@ void PQCLEAN_HQCRMRS256_AVX2_vect_set_random(AES_XOF_struct *ctx, uint64_t *v) {
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }

View File

@ -11,9 +11,7 @@
#include "api.h" #include "api.h"
#define CEIL_DIVIDE(a, b) (((a)/(b)) + ((a) % (b) == 0 ? 0 : 1)) /*!< Divide a by b and ceil the result*/ #define CEIL_DIVIDE(a, b) (((a)+(b)-1)/(b)) /*!< Divide a by b and ceil the result*/
#define BITMASK(a, size) ((1UL << ((a) % (size))) - 1) /*!< Create a mask*/
/* /*
#define PARAM_N Define the parameter n of the scheme #define PARAM_N Define the parameter n of the scheme

View File

@ -148,7 +148,7 @@ void PQCLEAN_HQCRMRS256_CLEAN_vect_set_random(AES_XOF_struct *ctx, uint64_t *v)
seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES); seedexpander(ctx, rand_bytes, VEC_N_SIZE_BYTES);
memcpy(v, rand_bytes, VEC_N_SIZE_BYTES); memcpy(v, rand_bytes, VEC_N_SIZE_BYTES);
v[VEC_N_SIZE_64 - 1] &= BITMASK(PARAM_N, 64); v[VEC_N_SIZE_64 - 1] &= RED_MASK;
} }