Skip to content

Math-equivalent optimisations #4

Description

@vanrein

There are a couple of places where modexp is used, but the other operations aren't modulo N. These places could be optimised by making them (mod N). That ought to be mathematically equivalent, and it is for multiplication.

As it turns out however, the test_srp program breaks when changing the subtraction B-k.g^x because this subtraction can yield a negative outcome which appears to be treated differently by the subsequent modexp operation. Might be a library issue, that supports a wider range of mathematics that we should avoid.

This optimisation has not been committed to the main branch yet, as it requires more work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions