8 Commits

Author SHA1 Message Date
Mamy Ratsimbazafy
c3b76cd420
32-bit fixes (#288)
* fix the new div2n1n_vartime on 32-bit - regression from #286

* remove unnecessary defensive programming

* reactivate 32-bit CI to check on #244

* 32-bit: centralize OS, ISA and env variable config

* enable assemble on x86 32-bit
2023-10-22 03:54:09 +02:00
Mamy Ratsimbazafy
4ccd8aaab8
EVM modexp: solve DOS vectors (#286)
* stash prep for Barret Reduction

* benches lost in rebase

* fix vartime reduction

* some improvement and fixes on reduce_vartime

* Fuse reductions when converting to Montgomery + use window=1 in powMont for small exponents. ~2.7x to 3.3x accel

* modexp: Introduce a no-reduction path for small base+exponent compared to modulus. Fix DOS

* optim for padded exponents

* remove commented out code [skip ci]

* Missing noInline for allocStackArray
2023-10-19 01:20:52 +02:00
Mamy Ratsimbazafy
6489053da9
Fix another even modulus pow uninitialized mem (#280) 2023-10-10 07:57:03 +02:00
Mamy Ratsimbazafy
f3a5f352b8
fuzz failure 5-3: Nim inclusive stops :/ (#267) 2023-09-09 09:20:01 +02:00
Mamy Ratsimbazafy
1ad8499ae5
fix fuzz 5 reloaded: modexp - endianness issue for exponent MSB (#266)
* fix fuzz 5 reloaded: endianness issue for exponent MSB

* refactoring typo in test vs gmp
2023-09-06 20:01:35 +02:00
Mamy Ratsimbazafy
c85ffb069a
fix fuzz 18: modexp - handling of infinitely right-padded inputs leading to buffer overflow or stack overflow (#264) 2023-09-06 15:00:29 +02:00
Mamy Ratsimbazafy
47b4f48dfb
fix overflow when truncating in submod2k, fix Guido fuzzing failure 8 (#251) 2023-07-11 09:06:46 +02:00
Mamy Ratsimbazafy
72f36530ba
Fix Fuzz 5: off-by-1 in even modexp (#247) 2023-07-02 17:14:50 +02:00