Giter VIP home page Giter VIP logo

Comments (6)

ValarDragon avatar ValarDragon commented on June 8, 2024

You can already implement non-pairing based curves from their parameters atm. (You can define curves in short weierstrass form or edwards form atm. Here is an example for an edwards curves: https://github.com/arkworks-rs/curves/tree/master/ed_on_bls12_381)

Theres no implementation at the moment for Curve25519, though you could add one by specifying the parameters. For curve25519 in particular though, I think it'd be best to add a wrapper of dalek's curve25519 implementation with the Arkworks group interface in https://github.com/arkworks-rs/curves . (Dalek's library should yield much better performance for Curve25519)

from curves.

weikengchen avatar weikengchen commented on June 8, 2024

After Curve25519 there might be Ristretto. https://ristretto.group/

from curves.

drewstone avatar drewstone commented on June 8, 2024

What method/software do you use to calculate the static BigNumbers? A bit unfamiliar with how to calculate R and others.

So far for Curve25519 I have:

	/// MODULUS = 57896044618658097711785492504343953926634992332820282019728792003956564819949
	#[rustfmt::skip]
	const MODULUS: BigInteger = BigInteger([
		0xffffffffffffffed,
		0xffffffffffffffff,
		0xffffffffffffffff,
		0x7fffffffffffffff,
	]);

	const MODULUS_BITS: u32 = 255;
	const CAPACITY: u32 = Self::MODULUS_BITS - 1;

	#[rustfmt::skip]
	const MODULUS_MINUS_ONE_DIV_TWO: BigInteger = BigInteger([
		0xfffffffffffffff6,
		0xffffffffffffffff,
		0xffffffffffffffff,
		0x3fffffffffffffff,
	]);

	// GENERATOR = 9

from curves.

weikengchen avatar weikengchen commented on June 8, 2024

Some description of these parameters and how to calculate them are here: https://github.com/arkworks-rs/algebra/blob/master/ff/src/fields/mod.rs#L202

Warning: some of them need to be in the Montgomery form. The documentation of this is still in progress.
(arkworks-rs/algebra#69)
This is why generator 7 does not look like 7.

These files may contain some discussion on what needs to be in the Montgomery form and what not.
https://github.com/arkworks-rs/curves/blob/master/ed_on_mnt4_298/src/fields/fr.rs
https://github.com/arkworks-rs/curves/blob/master/ed_on_mnt4_298/src/curves/mod.rs

from curves.

Pratyush avatar Pratyush commented on June 8, 2024

I would hold off a little on implementing this until this PR is merged: arkworks-rs/algebra#96

This PR should make implementing this much easier

from curves.

weikengchen avatar weikengchen commented on June 8, 2024

Yes. That PR would simplify the matter a lot.

By the way, previously I used Python to calculate. To chop a big number into u64 u64, I use % pow(2, 64) and / pow(2, 64).

from curves.

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.