Appearance
@pqc-sdk/core / sign
Function: sign()
sign(
data,secretKey,options?):Promise<Uint8Array<ArrayBufferLike>>
Signs data with ML-DSA-65 (FIPS 204) in hedged mode (randomized signing, the standard's default). Returns the 3309-byte signature.
Parameters
data
string | Uint8Array<ArrayBufferLike>
secretKey
SecretKey<"ml-dsa-65">
options?
Returns
Promise<Uint8Array<ArrayBufferLike>>
Example
ts
import { pqc } from '@pqc-sdk/core';
const pair = await pqc.keys.generate({ algorithm: 'ml-dsa-65' });
const signature = await pqc.sign(document, pair.secretKey);