Skip to content

Commit

Permalink
mceliece6688128f: Fix compilation with msvc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Jun 29, 2024
1 parent 416413c commit 668a0ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cipher/mceliece6688128f.c
Original file line number Diff line number Diff line change
Expand Up @@ -1909,8 +1909,14 @@ static void layer(int16_t *p, const unsigned char *cb, int s, int n)
/* output position pos is by definition 1&(out[pos/8]>>(pos&7)) */
static void controlbitsfrompermutation(unsigned char *out,const int16 *pi,long long w,long long n)
{
#ifdef _MSC_VER
int32* temp = (int32*)_alloca((2 * n) * sizeof(int32));
int16* pi_test = (int16*)_alloca(n * sizeof(int16));
int16 diff;
#else
int32 temp[2*n];
int16 pi_test[n], diff;
#endif
int i;
unsigned char *ptr;

Expand Down Expand Up @@ -3328,7 +3334,11 @@ static int pk_gen(unsigned char * pk, const unsigned char * irr, uint32_t * perm
int i, j, k;
int row, c;

#ifdef _MSC_VER
uint64_t** mat = (uint64_t**)_alloca((PK_NROWS * nblocks_H) * sizeof(uint64_t));
#else
uint64_t mat[ PK_NROWS ][ nblocks_H ];
#endif

uint64_t mask;

Expand Down

0 comments on commit 668a0ce

Please sign in to comment.