Package: ed25519-axolotl
Curve25519 signatures like in the early AxolotlRustImportuseed25519_axolotl::{fast_signature,full_signature,decode_message,random_bytes,str_to_vec32,vec32_to_str,KeyPairverify,};Generate NewKeyPairthe seed needs 32 bytes length or moreif none, generate random keys// seed: Vec<u32>// let keys = KeyPair::new(Some(seed));letkeys=KeyPair::new(None);println!("{}",keys);Fast Signature64 byte signaturequick to sign and verifydon't possible to decode signature back to messageletkeys=KeyPair::new(None);letmsg=str_to_vec32("hello e25519 axolotl".to_string());letsignature=fast_signature(keys.prvk,msg.clone(),Some(random_bytes(64)));Full Signature(64 + message length) byte signatureslow to sign and verifyit is possible to decode the signature back to the messageletkeys=KeyPair::new(None);letmsg=str_to_vec32("hello e25519 axolotl".to_string());letsignature=full_signature(keys.prvk,msg.clone(),Some(random_bytes(64)));Validate Signaturesworks with both fast and full signaturesletkeys=KeyPair::new(None);letmsg=str_to_vec32("hello e25519 axolotl".to_string());letsignature_full=full_signature(keys.prvk,msg.clone(),Some(random_bytes(64)));assert_eq!(true,validate_signature(keys.pubk,msg,signature_full));letsignature_fast=fast_signature(keys.prvk,msg.clone(),Some(random_bytes(64)));assert_eq!(true,validate_signature(keys.pubk,msg,signature_fast));Decode Messagepossible only for full_signature functionletkeys=KeyPair::new(None);letmsg=str_to_vec32("hello e25519 axolotl".to_string());letmutsign_msg=full_signature(keys.prvk,msg.clone(),Some(random_bytes(64)));letdecoded_msg=decode_message(keys.pubk,&mutsign_msg);NodeJs (WebAssembly)Importimport*aswasmfrom"ed25519_axolotl";orconstwasm=require("ed25519_axolotl")Generate NewKeyPairthe seed needs 32 bytes length or moreif none, generate random keys// const seed =  wasm.stringToUint32Array("your seed with 32 bytes of length or more")// const keys = new wasm.KeyPair(seed)constkeys=newwasm.KeyPair()Fast Signature64 byte signaturequick to sign and verifydon't possible to decode signature back to messageconstkeys=newwasm.KeyPair()constmsg=wasm.stringToUint32Array("hello lunes")constsignature=wasm.fastSignature(k.privateKey,msg,wasm.randomBytes(64))Full Signature(64 + message length) byte signatureslow to sign and verifyit is possible to decode the signature back to the messageconstkeys=newwasm.KeyPair()constmsg=wasm.stringToUint32Array("hello lunes")constsignature=wasm.fullSignature(k.privateKey,msg,wasm.randomBytes(64))Validate Signaturesworks with both fast and full signaturesconstkeys=newwasm.KeyPair()constmsg=wasm.stringToUint32Array("hello lunes")constsignatureFast=wasm.fastSignature(keys.privateKey,msg,wasm.randomBytes(64))constvalidated=wasm.validateSignature(keys.publicKey,msg,signatureFast)constsignatureFull=wasm.fullSignature(keys.privateKey,msg,wasm.randomBytes(64))constvalidated=wasm.validateSignature(keys.publicKey,msg,signatureFull)Decode Messagepossible only for full_signature functionconstkeys=newwasm.KeyPair()constmsg=wasm.stringToUint32Array("hello lunes")constsignature=wasm.fullSignature(keys.privateKey,msg,wasm.randomBytes(64))constdmsg=wasm.uint32ArrayToString(wasm.decode_message(keys.publiKey,signature))Python (Cython)Importfromed25519_axolotlimportKeyPairfromed25519_axolotlimport(validate_signature,fast_signature,full_signature,decode_message)Generate NewKeyPairthe seed needs 32 bytes length or moreif none, generate random keys# seed: bytes = [i for i in range(32)]# keys = KeyPair( seed )keys=KeyPair()keys.private_keykeys.public_keyFast Signature64 byte signaturequick to sign and verifydon't possible to decode signature back to messagekeys=KeyPair()message=b"hello lunes"signature=fast_signature(keys.private_key,message,random_bytes(64))Full Signature(64 + message length) byte signatureslow to sign and verifyit is possible to decode the signature back to the messagekeys=KeyPair()message=b"hello lunes"signature_full=full_signature(keys.private_key,message,random_bytes(64))Validate Signaturesworks with both fast and full signatureskeys=KeyPair()msg=b"hello lunes"signatureFast=fast_signature(k.private_key,msg,random_bytes(64))validated=validate_signature(keys.public_key,msg,signature_fast)signatureFull=fullSignature(k.private_key,msg,random_bytes(64))validated=validate_signature(keys.public_key,msg,signature_full)Decode Messagepossible only for full_signature functionkeys=KeyPair()message=b"hello lunes"signature_full=full_signature(keys.private_key,message,random_bytes(64))decode_msg=decode_message(keys.public_key,signature_full)like_string_msg=''.join(map(chr,decode_msg)))like_bytes_msg=bytes(decode_msg)like_list_int_msg=decode_msgCreditsPorted to Rust by Miguel Sandro Lucero,miguel.sandro@gmail.com, 2021.09.11, seehereCurve25519 signatures idea and math by Trevor Perrin, seehereDerived from axlsign.js written by Dmitry Chestnykh, seehereYou can use it under MIT.