Skip to content

Commit

Permalink
Changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
JackPiri committed Jun 4, 2024
1 parent fb87edc commit fe75643
Show file tree
Hide file tree
Showing 17 changed files with 119 additions and 130,283 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
name = "risc0-verifier"
version = "0.1.0"
edition = "2021"
rust-version = "1.60"
license = "Apache-2.0"
repository = "https://github.com/HorizenLabs/risc0-verifier"
authors = ["Horizen <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion HEADER-APACHE2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024, The Horizen Foundation
// Copyright 2024, Horizen Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
16 changes: 5 additions & 11 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ command = "cargo"
args = ["test"]

[tasks.format_inst]
[tasks.format-inst]
install_crate = { crate_name = "rustfmt", rustup_component_name = "rustfmt", binary = "rustfmt", test_arg = "--help" }

[tasks.format]
dependencies = ["format_inst"]
dependencies = ["format-inst"]
command = "cargo"
args = ["fmt"]

[tasks.format-check]
dependencies = ["format_inst"]
dependencies = ["format-inst"]
command = "cargo"
args = ["fmt", "--check"]

Expand Down Expand Up @@ -60,11 +61,6 @@ args = ["audit"]
command = "cargo"
args = ["llvm-cov", "--workspace", "--lcov", "--output-path", "lcov.info"]

[tasks.bench]
dependencies = ["test"]
command = "cargo"
args = ["bench"]

[tasks.udeps-inst]
command = "cargo"
args = ["install", "cargo-udeps", "--locked"]
Expand All @@ -77,9 +73,7 @@ args = ["udeps", "--all-targets"]


[tasks.ci]
#dependencies = ["build", "test", "format", "header-add", "clippy", "audit"]
dependencies = ["build", "test", "format", "clippy", "audit"]
dependencies = ["build", "test", "format", "header-add", "clippy", "audit"]

[tasks.ci-remote]
#dependencies = ["build", "test", "format-check", "header-check", "clippy", "audit"]
dependencies = ["build", "test", "format-check", "clippy", "audit"]
dependencies = ["build", "test", "format-check", "header-check", "clippy", "audit"]
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
# risc0-verifier

A verifier for [RISC-Zero](https://github.com/risc0/risc0) STARK proofs. This crate
A verifier for [RISC-Zero](https://github.com/risc0/risc0) STARK proofs.

This crate provides a way for deserializing the proof and the verification key (aka image id) and a function to check if the proof is correct:

```rust
use risc0_verifier::{verify, ProofRawData};
use risc0_verifier::{verify};
use serde::Deserialize;

let (proof_raw_data, image_id_data): (ProofRawData, [u32; 8]) = load_data(&path);
#[derive(Deserialize)]
struct Data {
proof_raw_data: String,
image_id: [u32; 8],
}

assert!(verify(proof_raw_data, image_id_data.into()).is_ok());
let Data {
proof_raw_data,
image_id,
} = serde_json::from_reader(std::fs::File::open("./resources/valid_proof_1.json").unwrap())
.unwrap();

let proof_raw_data = <Vec<u8>>::try_from(hex::decode(proof_raw_data).unwrap()).unwrap();

assert!(verify(&proof_raw_data, image_id.into()).is_ok());
```

## Develop
Expand Down
Binary file removed resources/guest_1/guest_1
Binary file not shown.
Loading

0 comments on commit fe75643

Please sign in to comment.