arkworks-rs / sponge Goto Github PK
View Code? Open in Web Editor NEWThis library is archived; see crypto-primities for the latest version of this code
License: Apache License 2.0
This library is archived; see crypto-primities for the latest version of this code
License: Apache License 2.0
It's likely https://eprint.iacr.org/2021/373 improves constructing Merkle trees here, although I've not explored this.
Design issue for a sponge trait that should be used across all projects that rely on the FS transform.
Tentative API:
pub enum ChallengeSize {
/// Sample challenges from the entire field.
Full,
/// Sample challenges from a subset of the field of size 2^num_bits.
Truncated { num_bits: usize },
}
pub trait FiatShamirSponge<F: Field> {
fn absorb(&mut self, input: impl Absorbable<F, S>);
fn squeeze(&mut self) -> F {
self.squeeze_with_size(ChallengeSize::Full)
}
fn squeeze_with_size(&mut self, size: ChallengeSize) -> F;
}
pub trait Absorbable<F: Field, S: FiatShamirSponge<F>> {
fn absorb_with_sponge(&self, sponge: &mut S);
}
Things to note:
Is the foregoing API sufficient for usecases like Fractal? I think it suffices for the Marlin compiler, and for poly-commit and accumulation-scheme challenge generation.
Prior work:
Apologies if this is naive question, but is this sponge crate meant just to provide hashing inside a SNARK or should it also provide things like a transcript type implementing ark_std::io::Write
so that ark_ff::bytes::ToBytes
works? If brief, does ark_merlin make any sense?
From meeting:
params: SpongeParams
, and then make decisions on how to serialize itself to optimize for better efficiency with the sponge (mostly useful for curve point serialization)trait Absorbable {
fn to_bytes_with_params(_params: SpongeParams) {
Self::to_bytes()
}
fn to_bytes();
// similar for field elements
}
TODO: Find better name for Sponge
trait
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.