1.0.4 • Published 2 years ago

@electron-labs/sha512 v1.0.4

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 years ago

SHA512

A circuit to compute SHA512 hash written in Circom.

Installation

npm install

Tests

npm test

Usage

include "sha512/sha512/sha512.circom";
include "circomlib/binsum.circom"; // make sure to include your copy of binsum.circom from circomblib

var INPUT_BITS = 1024; // number of bits of the input message
component sha512 = Sha512(INPUT_BITS);
for (var i = 0; i < INPUT_BITS; i++) {
    sha512.in[i] <== nullifierBits[i];
}
for (var i = 0; i < 512; i++) {
    out[i] <== sha512.out[i];
}

Constraint guarantees

The circuit only uses <== and doesn't use <-- thus ensuring that the circuit correctly generates all the constraints.

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.2

2 years ago