flutter_concrete 0.5.0
flutter_concrete: ^0.5.0 copied to clipboard
Concrete ML FHE client for Flutter. Native TFHE-rs encryption/decryption via Dart FFI with quantization support.
0.5.0 #
- Pure LWE keygen: Circuits with no bootstrapping keys (e.g. logistic regression, linear regression) now generate raw
LweSecretKeywith exact prime dimensions instead of failing on the GLWE extraction path. Existing keys generated by prior versions or by Python'sFHEModelClientare auto-detected and continue to work. - Fix encrypt/decrypt encoding: carry-bit delta convention now matches Concrete's
2^(64 - width - 1), unsigned outputs are no longer truncated by the width-bit mask, andlweEncryptSeededusesencodingWidthinstead ofconcreteShape.lastfor bits-per-value. - Fix quantization pipeline: removed spurious offset from output dequant formula to match Python's
scale * (raw - zp), separated input offset intoapplyInputOffsets()to match Python'sfhe.Client.encryptbehavior, and fixednBits/isSignedextraction from input quantizers inClientZipParser. - Per-class output zero points:
OutputQuantParamaccepts an optionalzeroPointslist for linear models that produce per-output-class zero point arrays. Single shared input quantizer support for linear models. - Swift Package Manager support: iOS builds now support SPM in addition to CocoaPods.
0.4.0 #
- Model-agnostic post-processing:
decryptAndDequantizenow applies the correct post-processing for each Concrete ML model type (tree ensembles, linear classifiers, neural networks, regressors), matching Python'sFHEModelClient.deserialize_decrypt_dequantize. - Auto-detection from
client.zip: Model class name (e.g.XGBClassifier) is parsed fromserialized_processing.jsonand mapped to the appropriate transform via a lookup table covering 17 standard Concrete ML sklearn models. PostProcessingsealed class: New public API with variantsauto,ensembleClassifier,ensembleProbabilistic,ensembleRegressor,xgbRegressor,classifier,regressor,none, andcustom. Pass as optional parameter todecryptAndDequantizeto override auto-detection.- Breaking:
dequantizeOutputsno longer performs tree aggregation. ThenClassesfield has been removed fromQuantizationParams. Post-processing (sum, softmax, sigmoid) is now handled byPostProcessing. Callers usingPostProcessing.auto()(the default) see identical behavior. - New getters:
ConcreteClient.modelClassName,ConcreteClient.detectedPostProcessing - Added dartdoc comments to all public API members
OutputQuantParamnow supports per-class zero points via optionalzeroPointsfield; single shared input quantizer support for linear models- Added
example/example.dart - Fixed lint issues (for-loop braces, unnecessary library name)
0.3.0 #
CiphertextFormat.CONCRETEsupport: Native seeded LWE encryption and decryption for Concrete's default ciphertext format. Enablesn_bits1–7 (no longer forced ton_bits=8), producing dramatically smaller circuits and faster inference.- Automatic format detection:
ConcreteClientreadsclient.specs.jsonto determine whether the model uses CONCRETE or TFHE-rs format and routes through the appropriate path. No public API changes. - Dynamic keygen parameters:
fhe_keygenderives GLWE dimensions from the circuit topology instead of hardcoding V0_10, supporting any parameter set the Concrete compiler chooses. - Cap'n Proto Value serialization: New
fhe_serialize_value/fhe_deserialize_valueFFI functions for Concrete's ciphertext transport format. - nClasses from output shape:
dequantizeOutputscorrectly aggregates per-tree scores for CONCRETE format models wheretfhers_specsis absent. - New internal types:
ConcreteCipherInfo,ConcreteCipherCompression
0.2.0 #
- Dynamic key topology: Keygen reads
client.specs.jsonfromclient.zipinstead of hardcoded key counts. Supports any Concrete ML circuit. - Multi-width encrypt/decrypt: Dispatches to FheUint8–64 / FheInt8–64 based on encoding width. No longer limited to uint8/int8.
- Model change detection: SHA-256 hash of topology + encoding stored in KeyStorage; keys auto-regenerate when the model changes.
Int64ListI/O for quantization with dynamic bit-width clamping
0.1.0 #
- Initial release
- ConcreteClient: setup from Concrete ML client.zip, key generation/restoration, quantize+encrypt, decrypt+dequantize
- KeyStorage abstract interface for key persistence
- 8-bit quantization (uint8 input, int8 output) compatible with Concrete ML models
- Cargokit-based native build with precompiled binary support
- Android and iOS platform support
0.1.1 #
- Updated README.md