Curve25519 signatures like in the early Axolotl

Rust

Import

rs use ed25519_axolotl::{ fast_signature, full_signature, decode_message, random_bytes, str_to_vec32, vec32_to_str, KeyPair verify, };

Generate New KeyPair

```rs // seed: Vec // let keys = KeyPair::new(Some(seed)); let keys = KeyPair::new(None);

println!("{}", keys); ```

Fast Signature

let msg = strtovec32("hello e25519 axolotl".tostring()); let signature = fastsignature( keys.prvk, msg.clone(), Some(random_bytes(64)) );

assert_eq!(verify(keys.pubk, msg, signature), true); println!("ok"); ```

Full Signature

let msg = strtovec32("hello e25519 axolotl".tostring()); let signature = fullsignature( keys.prvk, msg.clone(), Some(random_bytes(64)) );

assert_eq!(verify(keys.pubk, msg, signature), true); println!("ok"); ```

Decode Message

let msg = strtovec32("hello e25519 axolotl".tostring()); let mut signmsg = fullsignature( keys.prvk, msg.clone(), Some(randombytes(64)) ); let decodedmsg = decodemessage(keys.pubk, &mut sign_msg);

asserteq!(msg, decodedmsg); println!("ok"); ```

NodeJs (WebAssembly)

Import

js import * as wasm from "ed25519_axolotl"; or js const wasm = require("ed25519_axolotl")

Generate New KeyPair

```js const keys = new wasm.KeyPair()

console.log(keys.privateKey) // Uint32Array console.log(keys.publiKey) // Uint32Array ```

Fast Signature

console.log(keys.privateKey) // Uint32Array console.log(keys.publiKey) // Uint32Array

const msg = wasm.stringToUint32Array("hello lunes") console.log(msg) // Uint32Array

const signature = wasm.fastSignature(k.privateKey, msg, wasm.randomBytes(64)) console.log(signature) // Uint32Array ```

Full Signature

console.log(keys.privateKey) // Uint32Array console.log(keys.publiKey) // Uint32Array

const msg = wasm.stringToUint32Array("hello lunes") console.log(msg) // Uint32Array

const signature = wasm.fullSignature(k.privateKey, msg, wasm.randomBytes(64)) console.log(signature) // Uint32Array ```

Decode Message

console.log(keys.privateKey) // Uint32Array console.log(keys.publiKey) // Uint32Array

const msg = wasm.stringToUint32Array("hello lunes") console.log(msg) // Uint32Array

const signature = wasm.fullSignature(k.privateKey, msg, wasm.randomBytes(64)) console.log(signature) // Uint32Array

const dmsg = wasm.uint32ArrayToString( wasm.decode_message(k.publiKey, fl) ) console.log(dmsg) // String ```

Python (C/C++)

Import

js

Generate New KeyPair

js

Fast Signature

Full Signature

Decode Message

Credits