Add some functionalities for MuxChip

This commit is contained in:
Constance 2023-04-18 10:19:25 +02:00
parent 54697b22ed
commit 4ce262d8e7
2 changed files with 11 additions and 1 deletions

View File

@ -48,7 +48,7 @@ impl EccPoint {
/// Constructs a point from its coordinates, without checking they are on the curve.
///
/// This is an internal API that we only use where we know we have a valid curve point.
pub(crate) fn from_coordinates_unchecked(
pub fn from_coordinates_unchecked(
x: AssignedCell<Assigned<pallas::Base>, pallas::Base>,
y: AssignedCell<Assigned<pallas::Base>, pallas::Base>,
) -> Self {

View File

@ -139,6 +139,16 @@ impl<F: Field> AssignedCell<Assigned<F>, F> {
}
}
impl<F: Field> From<AssignedCell<F, F>> for AssignedCell<Assigned<F>, F> {
fn from(ac: AssignedCell<F, F>) -> Self {
AssignedCell {
value: ac.value.map(|a| a.into()),
cell: ac.cell,
_marker: Default::default(),
}
}
}
impl<V: Clone, F: Field> AssignedCell<V, F>
where
for<'v> Assigned<F>: From<&'v V>,