mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 10:41:57 +03:00
update default input file and examples
This commit is contained in:
parent
f286ba241d
commit
4b14d108b7
@ -2,5 +2,7 @@
|
||||
name = "fibonacci"
|
||||
version = "0.1.0"
|
||||
description = "Returns a fibonnaci sequence"
|
||||
remote = "aleo/fibonacci"
|
||||
license = "LICENSE-MIT"
|
||||
|
||||
[remote]
|
||||
author = "aleo"
|
||||
|
@ -2,5 +2,7 @@
|
||||
name = "hello-world"
|
||||
version = "0.1.0"
|
||||
description = "Returns the sum of two u32 integers"
|
||||
remote = "aleo/hello-world"
|
||||
license = "LICENSE-MIT"
|
||||
|
||||
[remote]
|
||||
author = "aleo"
|
||||
|
@ -2,5 +2,7 @@
|
||||
name = "pedersen-hash"
|
||||
version = "0.1.0"
|
||||
description = "A 256bit hash function"
|
||||
remote = "aleo/pedersen-hash"
|
||||
license = "LICENSE-MIT"
|
||||
|
||||
[remote]
|
||||
author = "aleo"
|
||||
|
@ -1,12 +1,12 @@
|
||||
circuit PedersenHash {
|
||||
parameters: group[256],
|
||||
parameters: [group; 256],
|
||||
|
||||
// Instantiates a Pedersen hash circuit
|
||||
static function new(parameters: group[256]) -> Self {
|
||||
static function new(parameters: [group; 256]) -> Self {
|
||||
return Self { parameters: parameters }
|
||||
}
|
||||
|
||||
function hash(bits: bool[256]) -> group {
|
||||
function hash(bits: [bool; 256]) -> group {
|
||||
let mut digest: group = 0;
|
||||
for i in 0..256 {
|
||||
if bits[i] {
|
||||
@ -21,6 +21,6 @@ circuit PedersenHash {
|
||||
function main() -> group {
|
||||
const parameters = [1group; 256];
|
||||
const pedersen = PedersenHash::new(parameters);
|
||||
let input: bool[256] = [true; 256];
|
||||
let input: [bool; 256] = [true; 256];
|
||||
return pedersen.hash(input)
|
||||
}
|
||||
|
@ -2,5 +2,7 @@
|
||||
name = "square-root"
|
||||
version = "0.1.0"
|
||||
description = "prove knowledge of the square root `a` of a number `b`"
|
||||
remote = "aleo/square-root"
|
||||
license = "LICENSE-MIT"
|
||||
|
||||
[remote]
|
||||
author = "aleo"
|
||||
|
@ -67,27 +67,27 @@ impl StateFile {
|
||||
|
||||
[state]
|
||||
leaf_index: u32 = 0;
|
||||
root: u8[32] = [0u8; 32];
|
||||
root: [u8; 32] = [0u8; 32];
|
||||
|
||||
[[private]]
|
||||
|
||||
[record]
|
||||
serial_number: u8[64] = [0u8; 64];
|
||||
commitment: u8[32] = [0u8; 32];
|
||||
serial_number: [u8; 64] = [0u8; 64];
|
||||
commitment: [u8; 32] = [0u8; 32];
|
||||
owner: address = aleo1daxej63vwrmn2zhl4dymygagh89k5d2vaw6rjauueme7le6k2q8sjn0ng9;
|
||||
is_dummy: bool = false;
|
||||
value: u64 = 5;
|
||||
payload: u8[32] = [0u8; 32];
|
||||
birth_program_id: u8[48] = [0u8; 48];
|
||||
death_program_id: u8[48] = [0u8; 48];
|
||||
serial_number_nonce: u8[32] = [0u8; 32];
|
||||
commitment_randomness: u8[32] = [0u8; 32];
|
||||
payload: [u8; 32] = [0u8; 32];
|
||||
birth_program_id: [u8; 48] = [0u8; 48];
|
||||
death_program_id: [u8; 48] = [0u8; 48];
|
||||
serial_number_nonce: [u8; 32] = [0u8; 32];
|
||||
commitment_randomness: [u8; 32] = [0u8; 32];
|
||||
|
||||
[state_leaf]
|
||||
path: u8[128] = [0u8; 128];
|
||||
memo: u8[32] = [0u8; 32];
|
||||
path: [u8; 128] = [0u8; 128];
|
||||
memo: [u8; 32] = [0u8; 32];
|
||||
network_id: u8 = 0;
|
||||
leaf_randomness: u8[32] = [0u8; 32];
|
||||
leaf_randomness: [u8; 32] = [0u8; 32];
|
||||
"#,
|
||||
self.package_name
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user