rename verify embed, update changelog
This commit is contained in:
parent
b4ebb1f7c1
commit
ce3a137432
8 changed files with 31 additions and 17 deletions
|
@ -1 +1 @@
|
||||||
Add SNARK verification to stdlib
|
Introduce the `snark_verify_bls12_377` embed for one-layer composition of SNARK proofs (over `BLS12-377`/`BW6-761` pair of curves where `BW6-761` is used as an outer curve to `BLS12-377`)
|
|
@ -16,7 +16,7 @@ use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
use typed_arena::Arena;
|
use typed_arena::Arena;
|
||||||
use zokrates_common::Resolver;
|
use zokrates_common::Resolver;
|
||||||
use zokrates_field::{Bn128Field, Field};
|
use zokrates_field::{Bn128Field, Bw6_761Field, Field};
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Debug)]
|
||||||
pub struct Error {
|
pub struct Error {
|
||||||
|
@ -106,8 +106,8 @@ impl Importer {
|
||||||
if T::id() != Bn128Field::id() {
|
if T::id() != Bn128Field::id() {
|
||||||
return Err(CompileErrorInner::ImportError(
|
return Err(CompileErrorInner::ImportError(
|
||||||
Error::new(format!(
|
Error::new(format!(
|
||||||
"Embed sha256round cannot be used with curve {}",
|
"Embed `sha256round` must be used with curve `{}`",
|
||||||
T::name()
|
Bn128Field::name()
|
||||||
))
|
))
|
||||||
.with_pos(Some(pos)),
|
.with_pos(Some(pos)),
|
||||||
)
|
)
|
||||||
|
@ -121,10 +121,24 @@ impl Importer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(feature = "ark")]
|
#[cfg(feature = "ark")]
|
||||||
"verify" => SymbolDeclaration {
|
"snark_verify_bls12_377" => {
|
||||||
id: symbol.get_alias(),
|
if T::id() != Bw6_761Field::id() {
|
||||||
symbol: Symbol::Flat(FlatEmbed::Verify),
|
return Err(CompileErrorInner::ImportError(
|
||||||
},
|
Error::new(format!(
|
||||||
|
"Embed `snark_verify_bls12_377` must be used with curve `{}`",
|
||||||
|
Bw6_761Field::name()
|
||||||
|
))
|
||||||
|
.with_pos(Some(pos)),
|
||||||
|
)
|
||||||
|
.in_file(location)
|
||||||
|
.into());
|
||||||
|
} else {
|
||||||
|
SymbolDeclaration {
|
||||||
|
id: symbol.get_alias(),
|
||||||
|
symbol: Symbol::Flat(FlatEmbed::Verify),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
"unpack" => SymbolDeclaration {
|
"unpack" => SymbolDeclaration {
|
||||||
id: symbol.get_alias(),
|
id: symbol.get_alias(),
|
||||||
symbol: Symbol::Flat(FlatEmbed::Unpack),
|
symbol: Symbol::Flat(FlatEmbed::Unpack),
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"entry_point": "./tests/tests/verify/verify_1.zok",
|
"entry_point": "./tests/tests/snark/snark_verify_bls12_377_1.zok",
|
||||||
"curves": ["Bw6_761"],
|
"curves": ["Bw6_761"],
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
|
@ -1,5 +1,5 @@
|
||||||
from "EMBED" import verify
|
from "EMBED" import snark_verify_bls12_377
|
||||||
|
|
||||||
def main(private field[1] inputs, private field[8] proof, private field[20] vk) -> bool:
|
def main(private field[1] inputs, private field[8] proof, private field[20] vk) -> bool:
|
||||||
bool result = verify(inputs, proof, vk)
|
bool result = snark_verify_bls12_377(inputs, proof, vk)
|
||||||
return result
|
return result
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"entry_point": "./tests/tests/verify/verify_2.zok",
|
"entry_point": "./tests/tests/snark/snark_verify_bls12_377_2.zok",
|
||||||
"curves": ["Bw6_761"],
|
"curves": ["Bw6_761"],
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
|
@ -1,5 +1,5 @@
|
||||||
from "EMBED" import verify
|
from "EMBED" import snark_verify_bls12_377
|
||||||
|
|
||||||
def main(private field[2] inputs, private field[8] proof, private field[22] vk) -> bool:
|
def main(private field[2] inputs, private field[8] proof, private field[22] vk) -> bool:
|
||||||
bool result = verify(inputs, proof, vk)
|
bool result = snark_verify_bls12_377(inputs, proof, vk)
|
||||||
return result
|
return result
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"entry_point": "./tests/tests/verify/verify_5.zok",
|
"entry_point": "./tests/tests/snark/snark_verify_bls12_377_5.zok",
|
||||||
"curves": ["Bw6_761"],
|
"curves": ["Bw6_761"],
|
||||||
"tests": [
|
"tests": [
|
||||||
{
|
{
|
|
@ -1,5 +1,5 @@
|
||||||
from "EMBED" import verify
|
from "EMBED" import snark_verify_bls12_377
|
||||||
|
|
||||||
def main(private field[5] inputs, private field[8] proof, private field[28] vk) -> bool:
|
def main(private field[5] inputs, private field[8] proof, private field[28] vk) -> bool:
|
||||||
bool result = verify(inputs, proof, vk)
|
bool result = snark_verify_bls12_377(inputs, proof, vk)
|
||||||
return result
|
return result
|
Loading…
Reference in a new issue