1
1
kopia lustrzana https://github.com/henrydcase/pqc.git synced 2024-11-22 07:35:38 +00:00

Remove BITMASK macro

This commit is contained in:
John M. Schanck 2020-09-09 16:52:51 -04:00 zatwierdzone przez Kris Kwiatkowski
rodzic 1325ba6dff
commit 6cf952a2ce
24 zmienionych plików z 24 dodań i 42 usunięć

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);
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;
}