liboqs 1.1.0
liboqs: ^1.1.0 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.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased #
1.1.0 - 2025-12-28 #
Added #
LibOQSUtils.constantTimeEquals()for timing-safe byte array comparison (prevents timing attacks)LibOQSUtils.zeroMemory()for secure memory zeroing using nativeOQS_MEM_cleanse(compiler-optimization resistant)clearSecrets()method toKEMKeyPair,KEMEncapsulationResult, andSignatureKeyPairfor explicit secret zeroing- Safe getters:
publicKeyBase64,publicKeyHex,ciphertextBase64,ciphertextHex(don't expose secrets) - Export
LibOQSUtilsfrom main library entry point - Security documentation in SECURITY.md, README.md, and CLAUDE.md
- Finalizers for automatic secret zeroing on garbage collection (
KEMKeyPair,KEMEncapsulationResult,SignatureKeyPair) - SHA256 checksum verification for native library downloads in build hooks (supply chain security)
- Comprehensive test coverage (100%):
exception_test.dart,utils_test.dart, extended KEM/Signature/Random tests - Test coverage reporting with GitHub Gist badge
make coveragecommand for local coverage testing- Centralized
get_version.dartscript for version parsing runDart/runDartOrFailhelpers incommon.dartfor consistent FVM usagecryptopackage dependency for SHA256 checksum verification
Changed #
LibOQSUtils.secureFreePointer()now uses nativeOQS_MEM_secure_freeinstead of manual zeroingLibOQSUtils.constantTimeEquals()now performs constant-time length comparison (prevents length oracle attacks)LibOQSUtils.constantTimeEquals()now usessecureFreePointer()for temporary buffersclearSecrets()and Finalizers now useOQS_MEM_cleansevia centralizedzeroMemory()function- Added documentation explaining silent failure behavior in
secureFreePointer()(by design for cryptographic libraries) - Native library version moved from
LIBOQS_VERSION/NATIVE_BUILDfiles topubspec.yaml(centralized version management) - All scripts now read version from
pubspec.yamlviaget_version.dart make regennow creates.skip_liboqs_hookmarker file to prevent Build Hooks during regenerationregenerate_bindings.dartnow uses FVM Dart when available
Fixed #
dispose()operation order in KEM and Signature classes (free → detach → flag) to prevent memory leaks on exceptions- Null pointer checks for native function pointers before calling
asFunction() OQSRandom.generateBytes()now usessecureFreePointerfor sensitive data- Added explicit
nullptrcheck inKEM.generateKeyPairDerand()forkeypair_derandfunction pointer - Added signature length validation in
Signature.verify()(empty check and max length check) OQSRandom.generateInt()now has retry limit to prevent potential infinite loops in rejection sampling- CI workflow now uses
--check-ignoreflag for coverage reporting (respectscoverage:ignoreannotations) - Regex replacement bug in
check_updates.dart(replaceFirst→replaceFirstMapped)
Security #
- Added security warnings to
toStrings()andtoHexStrings()methods that expose secret keys - Examples updated to use
constantTimeEquals()instead of loop-based comparison - Defense-in-depth: Finalizers automatically zero secrets if user forgets to call
clearSecrets() - Build hooks now verify SHA256 checksums of downloaded native libraries (prevents supply chain attacks)
Removed #
LIBOQS_VERSIONfile (version now inpubspec.yaml)NATIVE_BUILDfile (build number now inpubspec.yaml)
1.0.3 - 2025-12-18 #
Added #
- Add support "@Native" annotation instead use library loader class
- Add "NATIVE_BUILD" file to manage build number of native library
- Add settings for code formatter
1.0.2 - 2025-12-14 #
Added #
- Linux ARM64 (aarch64) platform support for native libraries
- Updated README platform support table with architecture details
Fixed #
- Library loading on Linux and Windows Flutter desktop apps (paths relative to executable)
- Library loading for CLI applications in both JIT (
dart run) and AOT (dart build cli) modes - AOT detection logic no longer incorrectly triggers on project paths containing "dart" substring
1.0.1 - 2025-12-14 #
1.0.0 - 2025-12-13 #
Added #
- Pre-built native libraries for all platforms (iOS, Android, macOS, Linux, Windows)
- Key Encapsulation Mechanisms (KEM): ML-KEM, Kyber, Classic McEliece, FrodoKEM, HQC, NTRU
- Digital Signatures: ML-DSA, SLH-DSA, Falcon, SPHINCS+, MAYO, CROSS
- Cryptographically secure random number generation (
OQSRandom) - Automatic native library bundling via FFI plugin configuration
LibOQS.init()for optional library pre-initializationLibOQS.getSupportedKEMAlgorithms()andLibOQS.getSupportedSignatureAlgorithms()for runtime algorithm discoveryLibOQS.isKEMSupported()andLibOQS.isSignatureSupported()for algorithm availability checks- Algorithm name validation in
KEM.create()andSignature.create() LibOQSUtils.secureFreePointer()for secure memory clearing (zeros memory before freeing)- Comprehensive test suite (44 tests)
- GitHub Actions CI/CD pipeline for automated testing and publishing
- Automated liboqs version tracking via
LIBOQS_VERSIONfile - Cross-platform build scripts for native library compilation
- Example Flutter application demonstrating all features
Security #
- Secret keys are automatically zeroed before memory is freed
- Based on liboqs 0.15.0 with NIST-standardized algorithms (FIPS 203, 204, 205)