Skip to content

const_residue doesn't seem to work outside of crate #191

Description

@olabiniV2

(Forgive me if this is an obvious problem based on my lack of Rust experience).

I'm trying to use the modular exp support recently added, but I'm running in to a problem with const_residue. Specifically, I do this:

impl_modulus!(PMod, U1536, P_STR);

where P_STR contains the hex string for the modulus. Then, in a test, I do:

let base = const_residue!(G1, PMod);

where G1 is a big int of the same size as the modulus. However, this leads to a failure saying "module uint is private". Specifically:

error[E0603]: module `uint` is private
   --> /home/amnesia/Persistent/.cargo/registry/src/github.com-1ecc6299db9ec823/crypto-bigint-0.5.0/src/uint/modular/constant_mod/macros.rs:48:17
    |
48  |         $crate::uint::modular::constant_mod::Residue::<$modulus, { $modulus::LIMBS }>::new(
    |                 ^^^^ private module
    |
note: the module `uint` is defined here
   --> /home/amnesia/Persistent/.cargo/registry/src/github.com-1ecc6299db9ec823/crypto-bigint-0.5.0/src/lib.rs:167:1
    |
167 | mod uint;
    | ^^^^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions