INNER CODE UNIT · Rust

max_amount

renegade-fi/renegade · crates/circuits/circuit-types/src/lib.rs:154

    let max_amount = (1u128 << AMOUNT_BITS) - 1;
    amount <= max_amount
}

/// Verify that a price is within the correct bitlength
pub fn validate_price_bitlength(price: FixedPoint) -> bool {
    let max_repr = (1u128 << PRICE_BITS) - 1;
    price.repr <= Scalar::from(max_repr)
}

/// Converts an element of the arkworks `ScalarField` to an `ark-mpc` type
/// `Scalar`
#[macro_export]
macro_rules! scalar {
    ($x:expr) => {
        Scalar::new($x)
    };
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…