Git Product home page Git Product logo

Comments (8)

burdges avatar burdges commented on July 18, 2024

We made some progress but I should take a stab at this.

from bls.

drskalman avatar drskalman commented on July 18, 2024

updated serialization and randomization now dealing with preparation.

from bls.

drskalman avatar drskalman commented on July 18, 2024

add prepare_publickey and prepare_signature to EngineBLS trait replacing missing AffineCurve::prepare method.

from bls.

drskalman avatar drskalman commented on July 18, 2024

8d44845 finishes the upgrade single.rs. However there are some points I need to ask @burdges:

  1. https://github.com/w3f/bls/blob/skalman-zexe-unprepared/src/single.rs#L665 doesn't fail but https://github.com/w3f/bls/blob/skalman-zexe-unprepared/src/single.rs#L671 can fail what should we do?
  2. https://github.com/w3f/bls/blob/skalman-zexe-unprepared/src/engine.rs#L249 I'm curious how to call prepare_g1 instead of re-pasting its body here.

from bls.

burdges avatar burdges commented on July 18, 2024

Where is serialize_uncompressed defined? I should never fail really.

prepare_g1::<Engine as PairingEngine> maybe, but why? I'd do a default method in the trait, so

trait .. {
    ..

    /// Prepare public key for Miller loop
    fn prepare_public_key(g: impl Into<Self::PublicKeyGroupAffine>) -> Self::PublicKeyPrepared {
        let g1: Self::PublicKeyGroupAffine = g.into();
        Self::PublicKeyPrepared::from(g1)
    }

    /// Prepare signature for Miller loop
    fn prepare_signature(g: impl Into<Self::SignatureGroupAffine>) -> Self::SignaturePrepared {
        let g2: Self::SignatureGroupAffine = g.into();
        Self::SignaturePrepared::from(g2)
    }
}

from bls.

drskalman avatar drskalman commented on July 18, 2024

Where is serialize_uncompressed defined? I should never fail really.

https://github.com/scipr-lab/zexe/blob/master/algebra-core/src/serialize/mod.rs#L60

from bls.

drskalman avatar drskalman commented on July 18, 2024

I'd do a default method in the trait

Ah that's much more elegant. But just out of curiosity why this doesn't work:

When I implement the function like this:

    fn prepare_public_key(g: impl Into<Self::PublicKeyGroupAffine>) -> Self::PublicKeyPrepared {
        prepare_g1(g)
    }

I get this:

error[E0284]: type annotations needed: cannot satisfy `<_ as PairingEngine>::G1Affine == <E as PairingEngine>::G1Affine`
   --> src/engine.rs:256:9
    |
256 |         prepare_g1(g)
    |         ^^^^^^^^^^ cannot satisfy `<_ as PairingEngine>::G1Affine == <E as PairingEngine>::G1Affine`

And If I implement it like this:

    fn prepare_public_key(g: impl Into<Self::PublicKeyGroupAffine>) -> Self::PublicKeyPrepared {
        prepare_g1::<E>(g)
    }

I get this:

    error[E0599]: no function or associated item named `prepare_g1` found for type parameter `E` in the current scope
   --> src/engine.rs:256:12
    |
256 |         E::prepare_g1(g)
    |            ^^^^^^^^^^ function or associated item not found in `E`

Do you know what is the correct way of doing that?

from bls.

burdges avatar burdges commented on July 18, 2024

Appears rustc has trouble unifying that bound, but really not sure why. If you've some minimized example or push it into a branch then we could ask someone who knows rustc open issues better.

from bls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.