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

    Class Snova2454Shake

    SNOVA-24-5-4-SHAKE digital signature wrapper class

    Snova2454Shake

    High-level wrapper for SNOVA-24-5-4-SHAKE signature operations. Provides secure key generation, signing, and verification 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 sig = await createSnova2454Shake();

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

    // Sign message
    const message = new TextEncoder().encode('Hello, quantum world!');
    const signature = sig.sign(message, secretKey);

    // Verify signature
    const isValid = sig.verify(message, signature, publicKey);

    // Cleanup
    sig.destroy();
    Index

    Accessors

    • get info(): {
          name: "SNOVA-24-5-4-SHAKE";
          identifier: "SNOVA_24_5_4_SHAKE";
          type: "sig";
          securityLevel: 1;
          standardized: false;
          description: string;
          keySize: { publicKey: 1016; secretKey: 48; signature: 248 };
      }

      Get algorithm information

      Returns {
          name: "SNOVA-24-5-4-SHAKE";
          identifier: "SNOVA_24_5_4_SHAKE";
          type: "sig";
          securityLevel: 1;
          standardized: false;
          description: string;
          keySize: { publicKey: 1016; secretKey: 48; signature: 248 };
      }

      Algorithm metadata

      console.log(sig.info.name);           // 'SNOVA-24-5-4-SHAKE'
      console.log(sig.info.securityLevel); // 1
      console.log(sig.info.keySize); // { publicKey: 1016, secretKey: 48, signature: 248 }

    Methods

    • Generate a new SNOVA-24-5-4-SHAKE keypair

      Returns { publicKey: Uint8Array; secretKey: Uint8Array }

      If instance is destroyed

      If key generation fails

      const { publicKey, secretKey } = sig.generateKeyPair();
      console.log('Public key:', publicKey.length); // 1016 bytes
      console.log('Secret key:', secretKey.length); // 48 bytes
    • Sign a message using the secret key

      Parameters

      • message: Uint8Array<ArrayBufferLike>

        Message to sign (arbitrary length)

      • secretKey: Uint8Array<ArrayBufferLike>

        Secret key for signing (48 bytes)

      Returns Uint8Array<ArrayBufferLike>

      Digital signature (up to 248 bytes)

      If instance is destroyed

      If inputs are invalid

      If signing fails

      const message = new TextEncoder().encode('Hello!');
      const signature = sig.sign(message, secretKey);
      console.log('Signature:', signature.length); // 248 bytes
    • Verify a signature against a message using the public key

      Parameters

      • message: Uint8Array<ArrayBufferLike>

        Original message that was signed

      • signature: Uint8Array<ArrayBufferLike>

        Signature to verify

      • publicKey: Uint8Array<ArrayBufferLike>

        Public key for verification (1016 bytes)

      Returns boolean

      True if signature is valid, false otherwise

      If instance is destroyed

      If inputs are invalid

      const isValid = sig.verify(message, signature, publicKey);
      if (isValid) {
      console.log('Signature is valid!');
      }
    • Free WASM resources

      Returns void

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

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