seb-m / curve41417.rs

A pure-Rust implementation of Curve41417

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Curve41417 Build Status

Description

A pure-Rust implementation of Curve41417. This code is experimental, don't use it for anything real.

Documentation

The generated documentation is available here.

Example

This basic example performs a Diffie-Hellman in Curve41417 Montgomery's representation:

extern crate curve41417;

use curve41417::mont::{gen_key, scalar_mult_base, scalar_mult};

let sk1 = gen_key();
let pk1 = scalar_mult_base(&sk1.read());

let sk2 = gen_key();
let pk2 = scalar_mult_base(&sk2.read());

let shared1 = scalar_mult(&sk1.read(), &pk2);
let shared2 = scalar_mult(&sk2.read(), &pk1);

assert_eq!(shared1, shared2);

For another example see curve41417_ops.rs.

Notes

  • This code is expected to target and compile with the current master branch of rustc.
  • This code is experimental and its crypto operations are highly unoptimized.
  • This code is mainly inspired by TweetNaCl and Ed25519.

License

This code is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

About

A pure-Rust implementation of Curve41417


Languages

Language:Rust 99.6%Language:Makefile 0.4%