Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update QuadExtField::sqrt for better performance #352

Merged
merged 1 commit into from
Nov 25, 2021

Commits on Nov 25, 2021

  1. Update QuadExtField::sqrt for better performance

    Currently, the QuadExtField uses an expensive runtime inverse of two
    calculation defined as `P::BaseField::one().double().inverse()`.
    
    With the proposed change, we compute the BigInt `(p+1)/2` that is ~15%
    cheaper than the previous method, by avoiding `inverse`.
    
    Alternatively, we could require a compile-time constant provided by the
    user that represents `1/2`. However, having a constant requirement to
    satisfy a single use-case isn't ideal.
    
    `PrimeField::modulus` was introduced to facilitate the available
    constants usage.
    
    Closes #210
    vlopes11 committed Nov 25, 2021
    Configuration menu
    Copy the full SHA
    e55606d View commit details
    Browse the repository at this point in the history