기본 콘텐츠로 건너뛰기

라벨이 해시인 게시물 표시

Circom SHA256 해시 예제

Circom SHA256 해시 예제 아래 문서의 예제를 약간 변형해서 SHA256 해시 검증을 실습하였습니다. Zero-Knowledge Proof of SHA256 Hash using zkSNARK , Binod, Medium 회로 생성 프로젝트 디렉토리에서 회로 파일 program.circom 작성 pragma circom 2.0.0; include "./circomlib/circuits/sha256/sha256.circom"; template program() { signal input in[8]; signal output out[256]; component SHA = Sha256(8); SHA.in <== in; out <== SHA.out; } component main = program(); 프로젝트 디렉토리에서 Git 저장소 circomlib 복제 git clone https://github.com/iden3/circomlib.git 회로 컴파일 circom program.circom --r1cs --wasm --sym --c 신뢰 설정 - Powers of Tau 프로젝트 디렉토리에서 ‘powers of tau’ ceremony 시작 snarkjs powersoftau new bn128 15 pot15_0000.ptau -v 첫 번째 기여 snarkjs powersoftau contribute pot15_0000.ptau pot15_0001.ptau --name="First contribution" -v 신뢰 설정 - Phase 2 program_js 디렉토리에서 Phase 2 준비 (시간이 많이 걸림) snarkjs powersoftau prepare phase2 ..\pot15_0001.ptau pot15_final.ptau -v .r1cs 파...