The explorer is out of sync. The last synced block is 491 hours ago. Current block height: explorer: 2206528 / node: 2520328 / ref: 2492275

Program multiplehashes.aleo

Program ID
multiplehashes.aleo
Owner signature
sign18xhdmzgnw0l9ymhg5djp8a58aywy3kvlzwl30fc5kpnyud5xucpzj7cgsnf3zn54xnxfjfhggqsg4pmmpa0kq2f56x9vxz92vzdkyq4fvgzh22rt0yd5z8aq7fjauukdr23lufp98fvw5t7v7dwqh6vzpc74h03deccdhkgwlldfzuakvn30hx3ys2zrvlrstkstyq05qeys2e02p0u
Times called
0
Similar programs
Imports
-
Mappings
-
Structs
Credentials
Records
SignedCredential
Functions
verify_hash
signature_verification
Transitions
issue(signature, address, u8, Credentials) -> (SignedCredential, boolean)
Program Source Code (Aleo Instruction) Upload Leo source

program multiplehashes.aleo;

struct Credentials:
    issuer as address;
    subject as address;
    dob as field;

record SignedCredential:
    owner as address.private;
    credential as Credentials.private;
    sig as signature.private;

closure verify_hash:
    input r0 as u8;
    input r1 as Credentials;
    is.eq r0 0u8 into r2;
    hash.psd2 r1 into r3 as field;
    is.eq r0 1u8 into r4;
    hash.bhp1024 r1 into r5 as field;
    is.eq r0 2u8 into r6;
    hash.sha3_256 r1 into r7 as field;
    is.eq r0 3u8 into r8;
    hash.keccak256 r1 into r9 as field;
    hash.psd2 r1 into r10 as field;
    not r2 into r11;
    not r4 into r12;
    and r11 r12 into r13;
    not r6 into r14;
    and r13 r14 into r15;
    and r15 r8 into r16;
    ternary r16 r9 r10 into r17;
    not r2 into r18;
    not r4 into r19;
    and r18 r19 into r20;
    and r20 r6 into r21;
    ternary r21 r7 r17 into r22;
    not r2 into r23;
    and r23 r4 into r24;
    ternary r24 r5 r22 into r25;
    ternary r2 r3 r25 into r26;
    output r26 as field;

closure signature_verification:
    input r0 as field;
    input r1 as signature;
    input r2 as address;
    sign_verify r1 r2 r0 into r3;
    output r3 as boolean;

function issue:
    input r0 as signature.private;
    input r1 as address.private;
    input r2 as u8.private;
    input r3 as Credentials.private;
    call verify_hash r2 r3 into r4;
    call verify_hash r2 r3 into r5;
    call signature_verification r5 r0 r3.issuer into r6;
    cast r3.subject r3 r0 into r7 as SignedCredential.record;
    output r7 as SignedCredential.record;
    output r6 as boolean.private;

Block heightTimestampTransition IDFunction callState
Program has no mappings.
Not implemented