Skip to content

Instantly share code, notes, and snippets.

@Michael-Qedit
Michael-Qedit / verify-soundness-of-music.rs
Created November 30, 2021 20:27
ZKHack - Puzzle 6 - Solution
#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(unreachable_code)]
#![allow(unused_imports)]
use ark_ff::{One, Zero};
use prompt::{puzzle, welcome};
use soundness_of_music::data::puzzle_data;
use soundness_of_music::prover;
@Michael-Qedit
Michael-Qedit / verify-strong-adaptivity.rs
Last active January 16, 2024 14:31
ZKHack - Puzzle 5 - Write-up
#![allow(unused, unreachable_code)]
///
/// ================================== ZKHACK Puzzle 5 - Write-Up ==================================
///
/// Michael ADJEDJ aka ZeroFearSyndrom
/// aka Michael-Qedit
///
/// => URL: https://www.zkhack.dev/puzzle5.html
/// => GitHub Repo: https://github.com/kobigurk/zkhack-strong-adaptivity
///
@Michael-Qedit
Michael-Qedit / verify-strong-adaptivity.rs
Created November 23, 2021 22:25
ZKHack - Puzzle 5 - Solution
#![allow(unused, unreachable_code)]
use ark_ed_on_bls12_381::Fr;
use ark_ff::{Field, UniformRand};
use strong_adaptivity::{Instance, Proof, data::puzzle_data, prove, Witness, ProofCommitment, ProofResponse};
use strong_adaptivity::verify;
use strong_adaptivity::PUZZLE_DESCRIPTION;
use prompt::{puzzle, welcome};
use rand::rngs::ThreadRng;
use std::ops::Div;
use strong_adaptivity::msg_equality_arg::utils::b2s_hash_to_field;
@Michael-Qedit
Michael-Qedit / verify-hidden-in-plain-sight.rs
Created November 21, 2021 14:33
ZKHack - Puzzle 4 - Write-up
///
/// ================================== ZKHACK Puzzle 4 - Write-Up ==================================
///
/// Michael ADJEDJ aka ZeroFearSyndrom
///
/// => URL: https://www.zkhack.dev/puzzle4.html
/// => GitHub Repo: https://github.com/kobigurk/zkhack-hidden-in-plain-sight
///
/// This write-up is written as a Rust file. The comment explains how to solve it, while the code
/// actually solves it. If you want to launch this solution by yourself, just replace the
@Michael-Qedit
Michael-Qedit / verify-hidden-in-plain-sight.rs
Created November 19, 2021 10:24
Solution to ZKHack puzzle 4
#![allow(unused, unreachable_code, dead_code)]
use ark_bls12_381::{Fr, G1Affine};
use ark_ff::*;
use ark_poly::{
univariate::DensePolynomial, EvaluationDomain, GeneralEvaluationDomain, Polynomial,
UVPolynomial,
};
use ark_serialize::CanonicalDeserialize;
use hidden_in_plain_sight::{generate::kzg_commit, PUZZLE_DESCRIPTION};
@Michael-Qedit
Michael-Qedit / verify-double-trouble.rs
Created November 13, 2021 18:17
Solution to ZHack puzzle 3
#![allow(unused, unreachable_code)]
use ark_ed_on_bls12_381::Fr;
use ark_ff::Field;
use double_trouble::data::puzzle_data;
use double_trouble::inner_product_argument::utils::challenge;
use double_trouble::verify;
use double_trouble::PUZZLE_DESCRIPTION;
use prompt::{puzzle, welcome};
use std::fmt::Display;
use std::str::FromStr;
@Michael-Qedit
Michael-Qedit / zkhack-2021-puzzle02.md
Created November 6, 2021 20:29
ZKHack - Puzzle 2 - WriteUp
@Michael-Qedit
Michael-Qedit / verify-trusted-setup.rs
Created November 6, 2021 17:40
Solution to ZKHack Puzzle 2
use ark_bls12_381::{Fr, Bls12_381, Fq12};
use ark_ec::{AffineCurve, PairingEngine};
use prompt::{puzzle, welcome};
use std::str::FromStr;
use trusted_setup::data::puzzle_data;
use trusted_setup::PUZZLE_DESCRIPTION;
use std::collections::HashMap;
fn main() {
welcome();