Skip to content

[Enhancement] Allow optional use of Node.js built-in crypto SHA-3 & SHAKE #16

@Harbinger-3

Description

@Harbinger-3

Currently, crystals-kyber uses the sha3 npm dependency and internally constructs hash objects like:

new SHA3(256);
new SHA3(512);
new SHAKE(128);
new SHAKE(256);

This works fine, but Node.js now supports SHA-3 and SHAKE algorithms natively via crypto.createHash (and crypto.createHmac) as of recent versions:

crypto.createHash('sha3-256');
crypto.createHash('sha3-512');
crypto.createHash('shake128', { outputLength: n });
crypto.createHash('shake256', { outputLength: n });

This removes reliance on external hashing implementation for Node.js environments.

Reduces install size and potential audit warnings from sha3 package.

Likely better performance due to native optimizations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions