Comments (1)
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)
- Azure Pipelines: % encoding failure
- Port tests to `unittest2`
- Insufficient private key validation (from nimbus-eth2)
- [Optim] Replace EIP2333 routines by builtin ones HOT 1
- Compiled version HOT 6
- Reject invalid serialized infinity points
- [BLST] Remove heap allocation on aggregateVerify HOT 1
- [SEC] Unnecessary HMAC Call in HKDF HOT 1
- [SEC] Insufficient Input Validation
- [SEC] Missing `norm` Operations
- [SEC] Infinity Public Key and Signature
- [SEC] Missing Check in `aggregate*()` Which Cannot Return INVALID HOT 1
- [SEC] Extraneous Exports and Dead Code HOT 1
- Azure pipelines is too slow HOT 1
- Upgrade BLST and remove 2 now unnecessary workarounds HOT 4
- [SEC] EIP 2386 Specification Completeness
- Miracl backend: Accelerate "KeyValidate" HOT 4
- BLST upgrade: notice of APi change HOT 1
- Fuzzing: multiple definition of functions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nim-blscurve.