Skip to content

v0.1.6

Choose a tag to compare

@iwater iwater released this 15 Dec 12:13
· 8 commits to main since this release

feat(crypto): Initial stable release of react-native-nitro-crypto

This commit marks the first official stable release of the react-native-nitro-crypto library, achieving full compatibility with Node.js Crypto APIs and the WebCrypto standard for React Native applications.

Key Features & Implementations:

  1. Full Node.js Crypto API Compatibility:

    • Implemented crypto.constants, crypto.randomUUID, crypto.getRandomValues.
    • Added support for Cipheriv and Decipheriv with AAD (Additional Authenticated Data) and Auth Tag support (AES-GCM/CCM/OCB).
    • Implemented DiffieHellman, DiffieHellmanGroup, and ECDH classes with support for classic and modern curves.
    • Implemented Hash, Hmac, Sign, Verify classes.
    • Added KeyObject implementation with full conversion support (from, toCryptoKey, export, asymmetricKeyDetails).
    • Implemented X509Certificate with extensive validation methods (checkEmail, checkHost, verify, checkIssued).
    • Added utility functions: hkdf, pbkdf2, scrypt, timingSafeEqual, checkPrime, generatePrime.
  2. WebCrypto API (SubtleCrypto) Standard Compliance:

    • Full implementation of subtle.importKey and subtle.exportKey supporting raw, pkcs8, spki, and jwk formats.
    • Implemented subtle.encrypt, subtle.decrypt, subtle.sign, subtle.verify, subtle.digest.
    • Implemented subtle.deriveKey, subtle.deriveBits (ECDH, X25519, X448, HKDF, PBKDF2).
    • Implemented subtle.wrapKey and subtle.unwrapKey for secure key transport (AES-KW, RSA-OAEP, AES-GCM).
    • Implemented subtle.generateKey for all supported algorithms.
  3. Advanced & Post-Quantum Cryptography (PQC) Support:

    • Post-Quantum Algorithms: Full support for ML-DSA (Module Lattice Digital Signature Algorithm) and ML-KEM (Module Lattice Key Encapsulation Mechanism) - levels 44/65/87 and 512/768/1024.
    • Modern Curves: Complete support for Ed25519, Ed448, X25519, and X448.
    • Modern Ciphers: Added support for ChaCha20-Poly1305 and AES-OCB.
  4. High-Performance Architecture:

    • Built on top of react-native-nitro-modules for efficient native bridging.
    • Core cryptography implemented in Rust for memory safety and performance, exposed via C-API.