Skip to content

perf: interleaved wNAF multiplication #2875

Description

@mattrighetti

I am using the jsonwebtoken crate, which uses ring internally, and I was trying to improve the latency on P384 verification which seems to be much slower than all the other crypto. After exploring this codebase for a bit and after some benchmarks I was pointed to this function which seems to be inefficient, as the function name says.

// XXX: Inefficient and unnecessarily depends on `PrivateKeyOps`. TODO: implement interleaved wNAF
// multiplication.
fn twin_mul_inefficient(

Before taking on this I wanted to discuss it here. Is the plan to import crypto/fipsmodule/ec/wnaf.c (e.g https://docs.ros.org/en/noetic/api/grpc/html/wnaf_8c_source.html) and implement the FFI calls so that it can replace the function above?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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