diff --git a/dagger/por/backends/backend_constantine.nim b/dagger/por/backends/backend_constantine.nim index 6cffd0bf..f3daefb5 100644 --- a/dagger/por/backends/backend_constantine.nim +++ b/dagger/por/backends/backend_constantine.nim @@ -11,6 +11,9 @@ # Shacham H., Waters B., "Compact Proofs of Retrievability" # using pairing over BLS12-381 ECC +# use BLS12_381 curve by default. +# Specify -d:por_curve_bn254 to use BN254_Snarks + import constantine, # constantine/platforms/abstractions, @@ -38,8 +41,10 @@ when defined(debugConstantine): export `$` #set up curve and G1/G2 -#const C = BN254_Snarks -const C = BLS12_381 +when defined(por_curve_bn254): + const C = BN254_Snarks +else: + const C = BLS12_381 type ec_SecretKey* = SecretKey diff --git a/dagger/por/por.nim b/dagger/por/por.nim index 2b71aa69..01a0b984 100644 --- a/dagger/por/por.nim +++ b/dagger/por/por.nim @@ -9,7 +9,15 @@ # Implementation of the BLS-based public PoS scheme from # Shacham H., Waters B., "Compact Proofs of Retrievability" -# using pairing over BLS12-381 ECC +# using pairing over the BLS12-381 ECC or BN254_Starks +# +# The implementation supports two backends: +# - BLST (default) +# - Constantine (-d:por_backend_constantine) +# +# The implementation supports PoR over the following curves: +# - BLS12-381 (default) +# - BN254_Starks (use -d:por_backend_constantine -d:por_curve_bn254) # # Notation from the paper # In Z: @@ -82,8 +90,10 @@ # - blst supports only the BLS12-381 curve # - constantine is more experimental, supports BLS and BN curves as well # As of now configuration of backends is in the backend_* file itself -import ./backends/backend_blst -#import ./backends/backend_constantine +when defined(por_backend_constantine): + import ./backends/backend_constantine +else: + import ./backends/backend_blst import ../rng import endians