|
@@ -1,27 +1,27 @@
|
|
|
//! Type aliases used in the codebase.
|
|
//! Type aliases used in the codebase.
|
|
|
// Helpful for changing the curve and crypto we're using.
|
|
// Helpful for changing the curve and crypto we're using.
|
|
|
use halo2_gadgets::ecc::FixedPoints;
|
|
use halo2_gadgets::ecc::FixedPoints;
|
|
|
-use pasta_curves as pasta;
|
|
|
|
|
|
|
+use pasta_curves::pallas;
|
|
|
|
|
|
|
|
use crate::crypto::{constants::OrchardFixedBases, util::mod_r_p};
|
|
use crate::crypto::{constants::OrchardFixedBases, util::mod_r_p};
|
|
|
|
|
|
|
|
-pub type DrkCircuitField = pasta::Fp;
|
|
|
|
|
|
|
+pub type DrkCircuitField = pallas::Base;
|
|
|
|
|
|
|
|
-pub type DrkTokenId = pasta::Fp;
|
|
|
|
|
-pub type DrkSerial = pasta::Fp;
|
|
|
|
|
|
|
+pub type DrkTokenId = pallas::Base;
|
|
|
|
|
+pub type DrkSerial = pallas::Base;
|
|
|
|
|
|
|
|
-pub type DrkCoin = pasta::Fp;
|
|
|
|
|
-pub type DrkCoinBlind = pasta::Fp;
|
|
|
|
|
|
|
+pub type DrkCoin = pallas::Base;
|
|
|
|
|
+pub type DrkCoinBlind = pallas::Base;
|
|
|
|
|
|
|
|
-pub type DrkNullifier = pasta::Fp;
|
|
|
|
|
|
|
+pub type DrkNullifier = pallas::Base;
|
|
|
|
|
|
|
|
-pub type DrkValue = pasta::Fp;
|
|
|
|
|
-pub type DrkScalar = pasta::Fq;
|
|
|
|
|
-pub type DrkValueBlind = pasta::Fq;
|
|
|
|
|
-pub type DrkValueCommit = pasta::Ep;
|
|
|
|
|
|
|
+pub type DrkValue = pallas::Base;
|
|
|
|
|
+pub type DrkScalar = pallas::Scalar;
|
|
|
|
|
+pub type DrkValueBlind = pallas::Scalar;
|
|
|
|
|
+pub type DrkValueCommit = pallas::Point;
|
|
|
|
|
|
|
|
-pub type DrkPublicKey = pasta::Ep;
|
|
|
|
|
-pub type DrkSecretKey = pasta::Fp;
|
|
|
|
|
|
|
+pub type DrkPublicKey = pallas::Point;
|
|
|
|
|
+pub type DrkSecretKey = pallas::Base;
|
|
|
|
|
|
|
|
pub fn derive_public_key(s: DrkSecretKey) -> DrkPublicKey {
|
|
pub fn derive_public_key(s: DrkSecretKey) -> DrkPublicKey {
|
|
|
OrchardFixedBases::SpendAuthG.generator() * mod_r_p(s)
|
|
OrchardFixedBases::SpendAuthG.generator() * mod_r_p(s)
|