constantine
constantine copied to clipboard
Constantine: modular, high-performance, zero-dependency cryptography stack for proof systems and blockchain protocols.
This PR helps providing pricing feedback for [EIP-2537](https://eips.ethereum.org/EIPS/eip-2537) and also implements it. - [ ] Metering the low-level primitives. _Note: as metering does not use hardware perf counters and also...
From https://github.com/mratsim/constantine/pull/370#issuecomment-2081212632 ## Overview Command: ``` nim c -d:CTT_ASM=false --tlsEmulation=off -d:danger --panics:on -d:noSignalHandler --mm:arc -d:useMalloc --verbosity:0 --hints:off --warnings:off --passC:-fno-semantic-interposition --passC:-falign-functions=64 --passC:-fmerge-all-constants --threads:on --noMain --app:staticlib --nimMainPrefix:ctt_init_ --out:libconstantine.a --outdir:lib --nimcache:nimcache/libconstantine_static bindings/lib_constantine.nim ```...
See #372 Github runners now use ARM64 instead of x86 for MacOS. Constantine failed to compile for inline assembly when the target CPU architecture is not explicit. This suggests that...
It seems like assembly for Apple Clang changed: https://github.com/mratsim/constantine/actions/runs/8862799707/job/24336160802?pr=370 ``` /Users/runner/work/constantine/constantine/constantine/nimcache/libcurves_headers/@m..@sconstantine@splatforms@sisa@scpudetect_x86.nim.c:80:8: error: invalid output constraint '=a' in asm :"=a"(result.eax), "=b"(result.ebx), "=c"(result.ecx), "=d"(result.edx) ^ ``` https://github.com/mratsim/constantine/blob/976c8bb215a3f0b21ce3d05f894eb506072a6285/constantine/platforms/isa/cpudetect_x86.nim#L17-L36
Addresses #359 . Implemented the sqrtPrecomp_PrimitiveDyadicRoots in Sage. However I would need some help on defining the ret array in sage as I didn't come across any helpful SageMath docs.
The PR #354 adds the pre-comp optimisation for `sqrt`, which has the constants prepared only for - Banderwagon Curve - Bandersnatch Curve A `sage` script is supposed to be added...
From https://github.com/mratsim/constantine/pull/364#pullrequestreview-1926092368 ## Easy - [ ] there is a `newSeq` introduced that needs to be replaced to avoid dependency on Nim runtime, especially if we want to expose IPA...
Wrong result for a particular G2 MSM calculation (this time `multiScalarMul_vartime` is affected). Unfortunately I don't have a small example (so far the smallest one is ~24,000 elements) and I...
The Polynomial primitives need to be refactored. - EIP-7594 (https://github.com/mratsim/constantine/issues/341) will require a lot of new polynomial primitives: \ https://github.com/ethereum/consensus-specs/blob/fe8db03/specs/_features/eip7594/polynomial-commitments-sampling.md [Polynomials in coefficient form](https://github.com/ethereum/consensus-specs/blob/fe8db03f45609e9dd0abeede10294d77ef6fb92c/specs/_features/eip7594/polynomial-commitments-sampling.md#polynomials-in-coefficient-form) [polynomial_eval_to_coeff](https://github.com/ethereum/consensus-specs/blob/fe8db03f45609e9dd0abeede10294d77ef6fb92c/specs/_features/eip7594/polynomial-commitments-sampling.md#polynomial_eval_to_coeff) [add_polynomialcoeff](https://github.com/ethereum/consensus-specs/blob/fe8db03f45609e9dd0abeede10294d77ef6fb92c/specs/_features/eip7594/polynomial-commitments-sampling.md#add_polynomialcoeff) [neg_polynomialcoeff](https://github.com/ethereum/consensus-specs/blob/fe8db03f45609e9dd0abeede10294d77ef6fb92c/specs/_features/eip7594/polynomial-commitments-sampling.md#neg_polynomialcoeff) [multiply_polynomialcoeff](https://github.com/ethereum/consensus-specs/blob/fe8db03f45609e9dd0abeede10294d77ef6fb92c/specs/_features/eip7594/polynomial-commitments-sampling.md#multiply_polynomialcoeff) [divide_polynomialcoeff](https://github.com/ethereum/consensus-specs/blob/fe8db03f45609e9dd0abeede10294d77ef6fb92c/specs/_features/eip7594/polynomial-commitments-sampling.md#divide_polynomialcoeff) [shift_polynomialcoeff](https://github.com/ethereum/consensus-specs/blob/fe8db03f45609e9dd0abeede10294d77ef6fb92c/specs/_features/eip7594/polynomial-commitments-sampling.md#shift_polynomialcoeff)...
# The square root with precomp optimisation is not currently in constant-time PR #354 adds the precomp optimisation to the square-root for Banderwagon/Bandersnatch. The implementation needs to be changed to...