rs
use ed25519_axolotl::{
fast_signature,
full_signature,
decode_message,
random_bytes,
str_to_vec32,
vec32_to_str,
KeyPair
verify,
};
KeyPair
```rs
// seed: Vec
println!("{}", keys); ```
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"); ```
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"); ```
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"); ```
js
import * as wasm from "ed25519_axolotl";
or
js
const wasm = require("ed25519_axolotl")
KeyPair
```js const keys = new wasm.KeyPair()
console.log(keys.privateKey) // Uint32Array console.log(keys.publiKey) // Uint32Array ```
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 ```
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 ```
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 ```
js
KeyPair
js
js
js
js