Skip to content

Commit

Permalink
Account for lack of MSVC VLA support.
Browse files Browse the repository at this point in the history
  • Loading branch information
AmineKhaldi committed May 7, 2023
1 parent a202742 commit 8dae624
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/low/gmp/relic_bn_mul_low.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include <gmp.h>

#include "relic_alloc.h"
#include "relic_bn.h"
#include "relic_bn_low.h"
#include "relic_util.h"
Expand All @@ -49,7 +50,8 @@ dig_t bn_mul1_low(dig_t *c, const dig_t *a, dig_t digit, int size) {
}

dig_t bn_muls_low(dig_t *c, const dig_t *a, dig_t sa, dis_t digit, int size) {
dig_t _a[size], carry, sign, sd = digit >> (RLC_DIG - 1);
dig_t carry, sign, sd = digit >> (RLC_DIG - 1);
dig_t* _a = RLC_ALLOCA(dig_t, size);

sa = -sa;
sign = sa ^ sd;
Expand All @@ -63,6 +65,7 @@ dig_t bn_muls_low(dig_t *c, const dig_t *a, dig_t sa, dis_t digit, int size) {
for (size_t i = 0; i < size; i++) {
c[i] = c[i] ^ sign;
}
RLC_FREE(_a);
return (carry ^ sign) + mpn_add_1(c, c, size, -sign);
}

Expand Down

0 comments on commit 8dae624

Please sign in to comment.