Open weikengchen opened 2 years ago
What about:
pub struct ProjectiveVar<
P: SWModelParameters,
F: FieldVar<P::BaseField, CF>,
CF: PrimeField = <P::BaseField as Field>::BasePrimeField,
> {
}
... would that not suffice here? I suppose that too will sit in the way quite often though.
Summary
This issue is to discuss how to make
NonNativeFieldVar
a drop-in replacement forFieldVar
in curve operations.Problem Definition
One of the reasons that we implemented FieldVar for NonNativeFieldVar is to allow it to be a drop-in replacement of FpVar, so that one doesn't need to build a hierarchy of nonnative primitives.
This, however, is not covered by the current implementation, see: https://github.com/arkworks-rs/r1cs-std/blob/master/src/groups/curves/short_weierstrass/mod.rs#L44
It would be ideal, though, to lift this restriction. However, we want to make sure that we don't change the existing writing system---it would be highly inconvenient to use
because it introduces one more param
CF
.A possible workaround, though not favorable, is to define
GeneralizedProjectVar<P, F, CF>
and letProjective<P, F> = GeneralizedProjectVar<P, F, <P::BaseField as Field>::BasePrimeField>
. This is not favored since nonnative field is not important to this level.Proposal
We need to think about what would be the best way to do this.
For Admin Use