Browse Source

Remove BITMASK macro

tags/v0.0.1
John M. Schanck 4 years ago
committed by Kris Kwiatkowski
parent
commit
6cf952a2ce
24 changed files with 24 additions and 42 deletions
  1. +1
    -2
      crypto_kem/hqc-128/avx2/parameters.h
  2. +1
    -1
      crypto_kem/hqc-128/avx2/vector.c
  3. +1
    -2
      crypto_kem/hqc-128/clean/parameters.h
  4. +1
    -1
      crypto_kem/hqc-128/clean/vector.c
  5. +1
    -2
      crypto_kem/hqc-192/avx2/parameters.h
  6. +1
    -1
      crypto_kem/hqc-192/avx2/vector.c
  7. +1
    -2
      crypto_kem/hqc-192/clean/parameters.h
  8. +1
    -1
      crypto_kem/hqc-192/clean/vector.c
  9. +1
    -2
      crypto_kem/hqc-256/avx2/parameters.h
  10. +1
    -1
      crypto_kem/hqc-256/avx2/vector.c
  11. +1
    -2
      crypto_kem/hqc-256/clean/parameters.h
  12. +1
    -1
      crypto_kem/hqc-256/clean/vector.c
  13. +1
    -3
      crypto_kem/hqc-rmrs-128/avx2/parameters.h
  14. +1
    -1
      crypto_kem/hqc-rmrs-128/avx2/vector.c
  15. +1
    -3
      crypto_kem/hqc-rmrs-128/clean/parameters.h
  16. +1
    -1
      crypto_kem/hqc-rmrs-128/clean/vector.c
  17. +1
    -3
      crypto_kem/hqc-rmrs-192/avx2/parameters.h
  18. +1
    -1
      crypto_kem/hqc-rmrs-192/avx2/vector.c
  19. +1
    -3
      crypto_kem/hqc-rmrs-192/clean/parameters.h
  20. +1
    -1
      crypto_kem/hqc-rmrs-192/clean/vector.c
  21. +1
    -3
      crypto_kem/hqc-rmrs-256/avx2/parameters.h
  22. +1
    -1
      crypto_kem/hqc-rmrs-256/avx2/vector.c
  23. +1
    -3
      crypto_kem/hqc-rmrs-256/clean/parameters.h
  24. +1
    -1
      crypto_kem/hqc-rmrs-256/clean/vector.c

+ 1
- 2
crypto_kem/hqc-128/avx2/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-128/avx2/vector.c 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);

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




+ 1
- 2
crypto_kem/hqc-128/clean/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-128/clean/vector.c 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);

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




+ 1
- 2
crypto_kem/hqc-192/avx2/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-192/avx2/vector.c 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);

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




+ 1
- 2
crypto_kem/hqc-192/clean/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-192/clean/vector.c 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);

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




+ 1
- 2
crypto_kem/hqc-256/avx2/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-256/avx2/vector.c 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);

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




+ 1
- 2
crypto_kem/hqc-256/clean/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-256/clean/vector.c 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);

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




+ 1
- 3
crypto_kem/hqc-rmrs-128/avx2/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-rmrs-128/avx2/vector.c 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);

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




+ 1
- 3
crypto_kem/hqc-rmrs-128/clean/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-rmrs-128/clean/vector.c 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);

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




+ 1
- 3
crypto_kem/hqc-rmrs-192/avx2/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-rmrs-192/avx2/vector.c 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);

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




+ 1
- 3
crypto_kem/hqc-rmrs-192/clean/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-rmrs-192/clean/vector.c 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);

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




+ 1
- 3
crypto_kem/hqc-rmrs-256/avx2/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-rmrs-256/avx2/vector.c 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);

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




+ 1
- 3
crypto_kem/hqc-rmrs-256/clean/parameters.h View File

@@ -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


+ 1
- 1
crypto_kem/hqc-rmrs-256/clean/vector.c 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);

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




Loading…
Cancel
Save