Skip to content

[sha3] Remove unnecessary buffers in absorbtion and squeezing #1501

Description

@robinhundt

There are a few places in the Sha3 hash and XOF implementation where we're allocating buffers on the stack which are not strictly needed. Removing these allocations could improve performance and reduce stack usage of the implementation.

Getting rid of the buffering in the XOF implementation could also enable us to unify the incremental and one-shot implementations, without a draw-back for the one-shot APIs.

Examples of such allocations:

let mut state_flat = [0u64; 25];

// Buffer inputs on absorb.
buf: [[u8; RATE]; PARALLEL_LANES],

And the squueze_buf introduced in #1389.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions