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

    Class CrossRsdpg128Small

    CROSS-rsdpg-128-small signature algorithm wrapper class

    CrossRsdpg128Small

    High-level wrapper for CROSS-rsdpg-128-small signature operations. Provides secure key generation, message signing, and signature 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 createCrossRsdpg128Small(moduleFactory);

    // 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);
    console.log('Valid:', isValid); // true

    // Cleanup
    sig.destroy();
    Index

    Accessors

    • get info(): {
          name: "CROSS-rsdpg-128-small";
          identifier: "CROSS-rsdpg-128-small";
          type: "sig";
          securityLevel: 1;
          standardized: false;
          description: string;
          keySize: { publicKey: 54; secretKey: 32; signature: 8960 };
      }

      Get algorithm information

      Returns {
          name: "CROSS-rsdpg-128-small";
          identifier: "CROSS-rsdpg-128-small";
          type: "sig";
          securityLevel: 1;
          standardized: false;
          description: string;
          keySize: { publicKey: 54; secretKey: 32; signature: 8960 };
      }

      Algorithm metadata

      console.log(sig.info.name);           // 'CROSS-rsdpg-128-small'
      console.log(sig.info.securityLevel); // 1
      console.log(sig.info.keySize); // { publicKey: 54, secretKey: 32, signature: 8640 }

    Methods

    • Generate a new CROSS-rsdpg-128-small 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); // 54 bytes
      console.log('Secret key:', secretKey.length); // 32 bytes
    • Sign a message with CROSS-rsdpg-128-small

      Parameters

      • message: Uint8Array<ArrayBufferLike>

        Message to sign (any length)

      • secretKey: Uint8Array<ArrayBufferLike>

        Secret key (32 bytes)

      Returns Uint8Array<ArrayBufferLike>

      Signature (variable length, max 8640 bytes)

      If instance is destroyed

      If secret key size is invalid

      If signing fails

      const message = new TextEncoder().encode('Sign this message');
      const signature = sig.sign(message, secretKey);
      console.log('Signature length:', signature.length);
    • Verify a CROSS-rsdpg-128-small signature

      Parameters

      • message: Uint8Array<ArrayBufferLike>

        Original message

      • signature: Uint8Array<ArrayBufferLike>

        Signature to verify

      • publicKey: Uint8Array<ArrayBufferLike>

        Public key (54 bytes)

      Returns boolean

      True if signature is valid, false otherwise

      If instance is destroyed

      If public key or signature size is invalid

      const isValid = sig.verify(message, signature, publicKey);
      if (isValid) {
      console.log('Signature is valid!');
      } else {
      console.log('Signature verification failed');
      }
    • 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