Skip to content

Replace crypto/rsa/blinding.c with Rust code #364

Closed

Description

@briansmith

We can now build on @djudd's work in #254 & #283, @ranweiler's work in #258, and the work #360 to replace crypto/rsa/blinding.c.

I imagine that we'll create something like this in src/rsa/blinding.rs:

struct BlindingState<F: Field> {
    factor: bigint::Elem<F>,
    factor_inverse: bigint::Elem<F>,
    counter: u32
}

When this is done, we can move GFp_BN_rand_range_ex to the crypto/test/ source file with the same license as crypto/bn/random.c and then make GFp_rand_mod be #[cfg(test)]. I think we can also delete crypto/rsa/internal.h when this is done.

The C code contains an optimization documented as:

    /* |GFp_BN_from_mont| + |GFp_BN_mod_inverse_blinded| is equivalent to,
     * but more efficient than, |GFp_BN_mod_inverse_blinded| + |GFp_BN_to_mont|.
     */

I suggest ignoring that optimization. It would hardly matter and it's likely that we'll implement a different, faster optimization later anyway, once I've done some math.

Activity

  1. added this to the 0.6 milestone on Dec 12, 2016
  2. self-assigned this
    on Dec 12, 2016
  3. briansmith commented on Dec 12, 2016

    @briansmith
    OwnerAuthor
  4. modified the milestones: 0.6, 0.6.1, on Dec 21, 2016
  5. briansmith commented on Jan 2, 2017

    @briansmith
    OwnerAuthor

    #372 landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions