oqs 3.3.1
oqs: ^3.3.1 copied to clipboard
Dart FFI bindings for liboqs — high-performance post-quantum cryptography (PQC) with ML-KEM, ML-DSA, Falcon, SPHINCS+ for key encapsulation and signatures.
3.3.1 #
Security #
- Applied public algorithm-name validation consistently in
KEM.create(),KEM.isSupported(),Signature.create(), andSignature.isSupported().
3.3.0 #
Added #
LibOQSUtils.freeSecure()for cryptographic memory cleansing usingOQS_MEM_cleanse.- Added
dispose()methods toKEMKeyPair,SignatureKeyPair, andKEMEncapsulationResultfor best-effort clearing of secret data in the Dart heap. - New
Heap Hygienetest suite insafety_validation_test.dart.
Fixed #
- Fixed critical security issue: Private keys and shared secrets are now securely zeroed in native memory before being freed.
- Fixed potential memory leaks by using
try-finallyblocks for all native pointer allocations. - Optimized
LibOQSUtils.pointerToUint8List()by usingsetRange()instead ofsublist(), reducing redundant memory copies. - Fixed type errors and improved null-safety in
SignatureandKEMimplementations. - Fixed logic error in
deterministic_key_generation_example.dartwhere public keys were printed as a tuple instead of being compared.
Changed #
- Updated all examples to demonstrate secure resource management and
try-finallypatterns.
Security #
- Integrated recommendation to use
OQS_MEM_cleansefor bypassing compiler optimizations when clearing sensitive material. - Enforced heap symmetry for native memory operations to prevent potential heap corruption on Windows.
3.2.1 #
3.2.0 #
Fixed #
OQSRandom.generateIntnow uses rejection sampling to eliminate modulo bias. Previously, values in the lower portion of the range were slightly more likely when the byte range did not evenly dividemax - min.OQSRandomExtensions.generateDoubleno longer risks signed 64-bit integer overflow when assembling random bytes. The value is now built from two unsigned 32-bit halves before conversion, ensuring a correct uniform distribution in [0, 1).Signature.signnow frees thesignatureLengthpointer correctly without an unnecessary cast.
Changed #
KEM.getSupportedKemAlgorithmsHardCodedList()is deprecated. UseKEM.getSupportedKemAlgorithms()directly.Signature.getSupportedSignatureAlgorithmsHardCodedList()is deprecated. UseSignature.getSupportedSignatureAlgorithms()directly.- Commented distro-specific GCC include paths from
ffigencompiler-optsinpubspec.yaml. Contributors on Fedora/RHEL who regenerate bindings may need to add their local GCC path (e.g.-I/usr/lib/gcc/x86_64-redhat-linux/15/include) to a localpubspec_overrides.yamlor pass it directly todart run ffigen.
3.1.0 #
Added #
- Linux ARM64 (aarch64) architecture support with automatic detection
linuxX64andlinuxArm64fields inLibraryPathsfor explicit Linux architecture configuration- Architecture-separated binary layout support for combined all-platforms archives
- Android ABI-specific subdirectories in combined archive structure (
android/<abi>/liboqs.so)
Changed #
LibraryPaths.fromBinaryRoot()now expects architecture-separated layout:lib/x86_64/liboqs.sofor Linux x86_64lib/aarch64/liboqs.sofor Linux ARM64android/<abi>/liboqs.sofor Android binaries
BinaryReleaseStrategyautomatically detects Linux architecture viauname -m- Combined binary archives no longer overwrite multi-architecture libraries
Deprecated #
linuxparameter inLibraryPathsconstructor (uselinuxX64instead;linuxstill works as alias)
Fixed #
- Multi-architecture Linux support (x86_64 and ARM64 no longer overwrite each other)
- Android ABI-specific loading in combined all-platforms archives
- Binary release archive structure to preserve all platform binaries
Migration Notes #
- Old
linuxparameter still works (maps tolinuxX64automatically) - Apps using individual platform archives are unaffected
- Apps using combined archive should re-download latest release with fixed structure
- To migrate existing code using
linux, optionally replace withlinuxX64for clarity
3.0.3 #
Fixed #
- Reduced pub.dev analyzer noise from generated FFI bindings by adding a
ffigenpreamble that ignoresunused_elementandunused_fieldinlib/src/bindings/liboqs_bindings.dart. - Regenerated bindings so
dart pub publish --dry-runno longer reports generated-code analyzer warnings.
3.0.2 #
Changed #
- Improved analyzer hygiene for better package quality scoring.
- Added
analysis_options.yamland excluded generated FFI bindings from analyzer noise. - Updated examples to use non-deprecated loader configuration (
LibOQSLoader.customPaths+LibraryPaths). - Cleaned minor lint issues in examples/tests.
Fixed #
dart analyzenow reports no issues in the package source/test/example set.
3.0.1 #
Changed #
- Expanded
README.mdinto a practical loading guide forliboqsintegration. - Documented exact dynamic library loading strategy precedence used by
LibOQSLoader. - Added platform-specific auto-path selection details (including Android ABI and iOS static linking behavior).
- Added cache behavior and debugging workflow for resolving load failures consistently.
3.0.0 #
Breaking Changes #
- Migrated runtime behavior and tests to
liboqs0.15.0bindings. - Removed reliance on hard-coded algorithm lists for public API discovery paths.
- Updated behavior assumptions for algorithm availability and key/signature sizes; these are now resolved from the loaded
liboqsbuild at runtime.
Changed #
- Switched KEM operations to stable top-level
liboqscalls:OQS_KEM_keypair_derandOQS_KEM_keypairOQS_KEM_encapsOQS_KEM_decaps
- Switched signature operations to stable top-level
liboqscalls:OQS_SIG_keypairOQS_SIG_signOQS_SIG_verify
LibOQS.getSupportedKEMAlgorithms()andLibOQS.getSupportedSignatureAlgorithms()now rely on runtime enumeration fromliboqs.
Fixed #
- Resolved FFI instability from direct struct function-pointer invocation by using exported function entry points.
- Updated tests to avoid brittle
0.14.xassumptions (fixed algorithm names/sizes) and use capability-based selection.
Migration Notes #
- Ensure native library version is
liboqs >= 0.15.0. - If your app assumes specific algorithm names (e.g. only
Kyber*/Dilithium*), move to runtime checks with:LibOQS.getSupportedKEMAlgorithms()LibOQS.getSupportedSignatureAlgorithms()
- Avoid hard-coding key/signature lengths; read them from the created
KEM/Signatureinstance.
2.4.0 #
Added #
- Per-platform library path configuration via
LibraryPathsclass LibraryPaths.fromBinaryRoot()factory for binary release integrationLibraryPaths.fromExtractedArchives()factory for separate platform archivesbinaryRootparameter toloadLibrary()for extracted release directories- iOS XCFramework support with
DynamicLibrary.process()static linking - Android ABI auto-detection from
Platform.version - Better error messages showing all attempted loading strategies
Changed #
- Improved library loading with more fallback strategies
- Enhanced
PackageRelativeStrategyto check binary release structure - Updated iOS loading to use static linking instead of dynamic library
Deprecated #
LibOQSLoader.customPath- useLibOQSLoader.customPathsinstead
Fixed #
- iOS library loading (was incorrectly trying to load
.dylib) - Android loading efficiency with ABI detection
- Memory safety in pointer operations with chunk-based copying