@openforge-sh/liboqs - v0.14.3
    Preparing search index...

    Class FrodoKEM1344AES

    FrodoKEM-1344-AES key encapsulation mechanism wrapper class

    FrodoKEM1344AES

    High-level wrapper for FrodoKEM-1344-AES KEM operations. Provides secure key generation, encapsulation, and decapsulation with automatic memory management.

    Memory Management:

    • All WASM memory is managed internally
    • Call destroy() when finished to free resources
    • Do not use instance after calling destroy()
    const kem = await createFrodoKEM1344AES();

    // Generate keypair
    const { publicKey, secretKey } = kem.generateKeyPair();

    // Encapsulate
    const { ciphertext, sharedSecret } = kem.encapsulate(publicKey);

    // Decapsulate
    const recoveredSecret = kem.decapsulate(ciphertext, secretKey);

    // Cleanup
    kem.destroy();
    Index

    Accessors

    • get info(): {
          name: "FrodoKEM-1344-AES";
          identifier: "FrodoKEM-1344-AES";
          type: "kem";
          securityLevel: 5;
          standardized: false;
          description: string;
          keySize: {
              publicKey: 21520;
              secretKey: 43088;
              ciphertext: 21632;
              sharedSecret: 32;
          };
      }

      Get algorithm information

      Returns {
          name: "FrodoKEM-1344-AES";
          identifier: "FrodoKEM-1344-AES";
          type: "kem";
          securityLevel: 5;
          standardized: false;
          description: string;
          keySize: {
              publicKey: 21520;
              secretKey: 43088;
              ciphertext: 21632;
              sharedSecret: 32;
          };
      }

      Algorithm metadata

      console.log(kem.info.name);           // 'FrodoKEM-1344-AES'
      console.log(kem.info.securityLevel); // 5
      console.log(kem.info.keySize); // { publicKey: 21520, secretKey: 43088, ciphertext: 21632, sharedSecret: 32 }

    Methods

    • Generate a new FrodoKEM-1344-AES keypair

      Returns { publicKey: Uint8Array; secretKey: Uint8Array }

      If instance is destroyed

      If key generation fails

      const { publicKey, secretKey } = kem.generateKeyPair();
      console.log('Public key:', publicKey.length); // 21520 bytes
      console.log('Secret key:', secretKey.length); // 43088 bytes
    • Encapsulate a shared secret using a public key

      Parameters

      • publicKey: Uint8Array<ArrayBufferLike>

        Public key (21520 bytes)

      Returns { ciphertext: Uint8Array; sharedSecret: Uint8Array }

      If instance is destroyed

      If public key size is invalid

      If encapsulation fails

      const { ciphertext, sharedSecret } = kem.encapsulate(publicKey);
      console.log('Ciphertext:', ciphertext.length); // 21632 bytes
      console.log('Shared secret:', sharedSecret.length); // 32 bytes
    • Decapsulate a shared secret using a secret key

      Parameters

      • ciphertext: Uint8Array<ArrayBufferLike>

        Ciphertext (21632 bytes)

      • secretKey: Uint8Array<ArrayBufferLike>

        Secret key (43088 bytes)

      Returns Uint8Array<ArrayBufferLike>

      Shared secret (32 bytes)

      If instance is destroyed

      If ciphertext or secret key size is invalid

      If decapsulation fails

      const sharedSecret = kem.decapsulate(ciphertext, secretKey);
      console.log('Recovered secret:', sharedSecret.length); // 32 bytes
    • Free WASM resources

      Returns void

      Releases all WASM memory associated with this instance. The instance cannot be used after calling destroy().

      kem.destroy();
      // kem is now unusable