Browse Source

Generalize TranscriptRepr implementation for slices (#150)

* generalize the slice implementation

* bump the version
main
Srinath Setty 1 year ago
committed by GitHub
parent
commit
cbbc1c6127
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions
  1. +1
    -1
      Cargo.toml
  2. +2
    -4
      src/traits/mod.rs

+ 1
- 1
Cargo.toml

@ -1,6 +1,6 @@
[package] [package]
name = "nova-snark" name = "nova-snark"
version = "0.18.0"
version = "0.18.1"
authors = ["Srinath Setty <srinath@microsoft.com>"] authors = ["Srinath Setty <srinath@microsoft.com>"]
edition = "2021" edition = "2021"
description = "Recursive zkSNARKs without trusted setup" description = "Recursive zkSNARKs without trusted setup"

+ 2
- 4
src/traits/mod.rs

@ -234,12 +234,10 @@ pub trait PrimeFieldExt: PrimeField {
fn from_uniform(bytes: &[u8]) -> Self; fn from_uniform(bytes: &[u8]) -> Self;
} }
impl<G: Group<Scalar = F>, F: PrimeField + TranscriptReprTrait<G>> TranscriptReprTrait<G>
for &[F]
{
impl<G: Group, T: TranscriptReprTrait<G>> TranscriptReprTrait<G> for &[T] {
fn to_transcript_bytes(&self) -> Vec<u8> { fn to_transcript_bytes(&self) -> Vec<u8> {
(0..self.len()) (0..self.len())
.map(|i| <F as TranscriptReprTrait<G>>::to_transcript_bytes(&self[i]))
.map(|i| self[i].to_transcript_bytes())
.collect::<Vec<_>>() .collect::<Vec<_>>()
.into_iter() .into_iter()
.flatten() .flatten()

Loading…
Cancel
Save