Skip to content

Commit

Permalink
refactor: restrict visibility of ECC
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Feb 28, 2024
1 parent f6439ae commit e19854e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
use crate::{
constants::{NIO_NOVA_FOLD, NUM_FE_WITHOUT_IO_FOR_CRHF, NUM_HASH_BITS},
gadgets::{
ecc::AllocatedPoint,
r1cs::{AllocatedR1CSInstance, AllocatedRelaxedR1CSInstance},
utils::{
alloc_num_equals, alloc_scalar_as_base, alloc_zero, conditionally_select_vec, le_bits_to_num,
},
AllocatedPoint,
},
r1cs::{R1CSInstance, RelaxedR1CSInstance},
traits::{
Expand Down
4 changes: 4 additions & 0 deletions src/gadgets/ecc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ impl<G: Group> AllocatedPoint<G> {
}

/// Returns coordinates associated with the point.
#[allow(unused)]
pub const fn get_coordinates(
&self,
) -> (
Expand Down Expand Up @@ -596,11 +597,13 @@ pub struct AllocatedPointNonInfinity<G: Group> {

impl<G: Group> AllocatedPointNonInfinity<G> {
/// Creates a new `AllocatedPointNonInfinity` from the specified coordinates
#[allow(unused)]
pub const fn new(x: AllocatedNum<G::Base>, y: AllocatedNum<G::Base>) -> Self {
Self { x, y }
}

/// Allocates a new point on the curve using coordinates provided by `coords`.
#[allow(unused)]
pub fn alloc<CS: ConstraintSystem<G::Base>>(
mut cs: CS,
coords: Option<(G::Base, G::Base)>,
Expand Down Expand Up @@ -636,6 +639,7 @@ impl<G: Group> AllocatedPointNonInfinity<G> {
}

/// Returns coordinates associated with the point.
#[allow(unused)]
pub const fn get_coordinates(&self) -> (&AllocatedNum<G::Base>, &AllocatedNum<G::Base>) {
(&self.x, &self.y)
}
Expand Down
7 changes: 5 additions & 2 deletions src/gadgets/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! This module implements various gadgets necessary for Nova and applications built with Nova.
pub mod ecc;
mod ecc;
pub(crate) use ecc::AllocatedPoint;

mod nonnative;
pub use nonnative::{bignat::nat_to_limbs, util::f_to_nat};
pub(crate) use nonnative::{bignat::nat_to_limbs, util::f_to_nat};

pub(crate) mod r1cs;
pub(crate) mod utils;
2 changes: 1 addition & 1 deletion src/supernova/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use crate::{
constants::{NIO_NOVA_FOLD, NUM_HASH_BITS},
gadgets::{
ecc::AllocatedPoint,
r1cs::{
conditionally_select_alloc_relaxed_r1cs,
conditionally_select_vec_allocated_relaxed_r1cs_instance, AllocatedR1CSInstance,
Expand All @@ -23,6 +22,7 @@ use crate::{
utils::{
alloc_num_equals, alloc_scalar_as_base, alloc_zero, conditionally_select_vec, le_bits_to_num,
},
AllocatedPoint,
},
r1cs::{R1CSInstance, RelaxedR1CSInstance},
traits::{commitment::CommitmentTrait, Engine, ROCircuitTrait, ROConstantsCircuit},
Expand Down

0 comments on commit e19854e

Please sign in to comment.