GithubHelp home page GithubHelp logo

Comments (1)

mratsim avatar mratsim commented on June 12, 2024

We unfortunately need one of those default init RFC in Nim nim-lang/RFCs#252.

The portable patterns are

# Low-level
var P {.noInit.}: ECP2_BLS12381
P.setInf
# High-level
var p {.noInit.}: Aggregate
p.init(firstElem)

If we need really empty aggregate within BLScurve (instead of just handling the special case at serialization/deserialization) we could add the following function with caveats for Miracl backend:

  func initEmpty*(agg: var Aggregate) {.inline.} =
    ## Initialize an empty aggregate signature or public key.
    ## This is a delicate procedure to use.
    ## 
    ## ⚠ Empty public-key or signatures created by this procedure
    ##   are infinity points to allow further aggregation.
    ##   - Some protocols might serialize an empty aggregate differently
    ##     from an infinity point, for example Ethereum:
    ##       Empty aggregate:         0x0000...0000
    ##       Infinity point ("zero"): 0xc000...0000
    ##   - Some protocols, like BLS signatures, might not allow raw empty aggregates of certain kind.
    agg.point.inf()

BLST has no public API to create infinity points (though default init is by chance the infinity point).

from nim-blscurve.

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.