mirror of
https://github.com/logos-storage/constantine.git
synced 2026-01-06 15:13:12 +00:00
* introduce sumprod for direct fp6_mul * change curves -> constants * forgotten constants * Full pairing using Fp2->Fp6->Fp12 towering
34 lines
1.1 KiB
Nim
34 lines
1.1 KiB
Nim
# Constantine
|
|
# Copyright (c) 2018-2019 Status Research & Development GmbH
|
|
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy
|
|
# Licensed and distributed under either of
|
|
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
|
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
import
|
|
# Internals
|
|
../config/curves,
|
|
./bls12_377_subgroups,
|
|
./bls12_381_subgroups,
|
|
./bn254_nogami_subgroups,
|
|
./bn254_snarks_subgroups,
|
|
./bw6_761_subgroups,
|
|
./pallas_subgroups,
|
|
./vesta_subgroups
|
|
|
|
export
|
|
bls12_377_subgroups,
|
|
bls12_381_subgroups,
|
|
bn254_nogami_subgroups,
|
|
bn254_snarks_subgroups,
|
|
bw6_761_subgroups
|
|
|
|
func clearCofactor*[ECP](P: var ECP) {.inline.} =
|
|
## Clear the cofactor of a point on the curve
|
|
## From a point on the curve, returns a point on the subgroup of order r
|
|
when ECP.F.C in {BN254_Nogami, BN254_Snarks, BLS12_377, BLS12_381}:
|
|
P.clearCofactorFast()
|
|
else:
|
|
P.clearCofactorReference()
|