GithubHelp home page GithubHelp logo

Comments (8)

howardwu avatar howardwu commented on June 12, 2024 1

@matthewdgreen I've implemented a list of new opcodes that include the aforementioned types. You can check the full list of new opcodes here: https://github.com/AleoHQ/snarkVM/pull/1576

The Leo team will introduce methods to integrate each of these opcodes soon.

from leo.

matthewdgreen avatar matthewdgreen commented on June 12, 2024 1

Awesome! I am writing a little test "library" that implements: classic Elgamal encryption/decryption, ECIES-like encryption/decryption, Schnorr signatures and an OPRF. These should support all of those cases (I think.)

from leo.

howardwu avatar howardwu commented on June 12, 2024 1

@matthewdgreen we've landed all of the features specified above into Aleo instructions. Leo will be updated over the next 1-2 weeks to support the same features.

commit.bhp256 r0 r1 into r2 as address;
commit.bhp256 r0 r1 into r2 as field;
commit.bhp256 r0 r1 into r2 as group;
commit.bhp512 ...;
commit.bhp768 ...;
commit.bhp1024 ...;
commit.ped64 ...;
commit.ped128 ...;
hash.bhp256 r0 into r1 as address;
hash.bhp256 r0 into r1 as field;
hash.bhp256 r0 into r1 as group;
hash.bhp256 r0 into r1 as i8;
hash.bhp256 r0 into r1 as i16;
hash.bhp256 r0 into r1 as i32;
hash.bhp256 r0 into r1 as i64;
hash.bhp256 r0 into r1 as i128;
hash.bhp256 r0 into r1 as u8;
hash.bhp256 r0 into r1 as u16;
hash.bhp256 r0 into r1 as u32;
hash.bhp256 r0 into r1 as u64;
hash.bhp256 r0 into r1 as u128;
hash.bhp256 r0 into r1 as scalar;
hash.bhp512 ...;
hash.bhp768 ...;
hash.bhp1024 ...;
hash.ped64 ...;
hash.ped128 ...;
hash.psd2 ...;
hash.psd4 ...;
hash.psd8 ...;

from leo.

matthewdgreen avatar matthewdgreen commented on June 12, 2024

Additionally, it would be nice if you could use Poseidon to hash to a group element. (This could be a combination of hashing to a field element and then assigning the field element to the x-coordinate of the group.)

from leo.

howardwu avatar howardwu commented on June 12, 2024

Agreed. We should introduce hash_to_group and hash_to_scalar for Poseidon. The impls are already in snarkVM.

from leo.

howardwu avatar howardwu commented on June 12, 2024

I see this repo and understand the motivation.

We're currently discussing introducing a group::GEN constant into Aleo instructions and Leo as well, so that there is direct access to the prime subgroup generator.

We're also currently looking into implementing cast instructions that can take out the x or y coordinate as so (in Aleo instructions):

input r0 as group.public;
cast r0 into r1 as group.x;
cast r0 into r2 as group.y;

This would of course then be mirrored in Leo as element.to_x_coordinate() and element.to_y_coordinate.

from leo.

howardwu avatar howardwu commented on June 12, 2024

We've added the group::GEN syntax in https://github.com/AleoHQ/snarkVM/pull/1594, which will land in the next snarkVM release today.

from leo.

d0cd avatar d0cd commented on June 12, 2024

@matthewdgreen
Leo now supports the features discussed above.

  1. group::to_x_coordinate(a) or a.to_x_coordinate()
  2. Poseidon2::hash_to_group(a)
  3. group::GEN

The relevant PRs are:

Some relevant examples are:

from leo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.