flutter_mldsa 0.1.4-dev.3 copy "flutter_mldsa: ^0.1.4-dev.3" to clipboard
flutter_mldsa: ^0.1.4-dev.3 copied to clipboard

unlisted

Pointycastle interface implentations for MlDsa using bindings to RustCrypto implementation of ml-dsa

Flutter MlDsa #

Pointycastle interface implentations for MlDsa using bindings to RustCrypto implementation of ml-dsa

⚠️ Security Warning #

The implementation contained in this crate has never been independently audited!

USE AT YOUR OWN RISK!

If you have discovered a security vulnerability in this project, please report it privately. Do not disclose it as a public issue. This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released. See SECURITY.md for more details.

Getting started #

Add flutter_mldsa and pointycastle to your dependencies

flutter pub add flutter_mldsa pointycastle

Usage #

  1. Initialize the FlutterMldsa:
await FlutterMldsa.init();
  1. Create a MlDsaKeyGenerator:
final keyGenerator = MlDsaKeyGenerator();

OR

final keyGenerator = KeyGenerator('Mldsa'); //Case sensitive
  1. Initialize the generator with a mode to generate
final generatorParams = MlDsaKeyGeneratorParams(mlDsaMode: MlDsaMode.MLDSA44);
keyGenerator.init(generatorParams);
  1. Generate a keypair:
final keypairA = keyGenerator.generateKeyPair();
  1. Create a Signer and initialize it:
final signer = MlDsaSigner();
signer.init(true, PrivateKeyParameter<MlDsaPrivateKey>(keypairA.privateKey));
  1. Create a verify and Initialize it:
final verifier = MlDsaSigner();
verifier.init(false, PublicKeyParameter<MlDsaPublicKey>(keypairA.publicKey));
  1. Use the MlDsaSigner functions to sign and verify:
final signature = signer.generateSignature(message);
final result = verifier.verifySignature(message, signature);
  1. (End of usage) Dispose the FlutterMldsa:
FlutterMldsa.dispose();

Testing #

Rust-Side #

cd rust
cargo test -- --show-output

Flutter-Side #

cd example
flutter test -d $DEVICE integration_test/master_integration_test.dart

where $DEVICE is set to a device on the platform you want to test (for example linux, emulator-5554)

License #

Licensed at:

0
likes
0
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

Pointycastle interface implentations for MlDsa using bindings to RustCrypto implementation of ml-dsa

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

equatable, flutter, flutter_rust_bridge, plugin_platform_interface, pointycastle

More

Packages that depend on flutter_mldsa

Packages that implement flutter_mldsa