Crate fp2

Source
Expand description

fp2-rs is a library for efficient and constant-time arithmetic for the finite field Fp^2

This library has been developed following a series of projects which needed finite field arithmetic over a number of different characteristics. Currently, the only intended usage for this code, is in isogeny-based cryptographic research, meaning the current functionality is tailored for a particular set of problems.

Modules§

fp2_gen
A macro to define efficient and constant-time arithmetic for the finite field Fp^2 with modulus x^2 + 1
fp_gen
A macro to define efficient and constant-time arithmetic for finite fields Fp with p = 3 mod 4 using Montgomery multiplication.
test_macros
Macros to generate deterministically random test vectors for finite fields
traits
Traits for implementing generic operations over finite fields.
utils64
Utility functions for performing arithmetic with u64 words

Macros§

define_fp2_from_modulus
A macro to define the degree two extension of the finite field Fp, with modulus x^2 + 1 directly from the modulus. All functions are designed to run in constant time.
define_fp2_from_type
A macro to define the degree two extension of the finite field Fp, with modulus x^2 + 1. All functions are designed to run in constant time.
define_fp2_tests
A macro to generate test vectors for a given finite field Fp^2.
define_fp_core
A macro to define the finite field Fp, all functions are designed to run in constant time. Assumes that the characteristic is p = 3 mod 4.
define_fp_tests
A macro to generate test vectors for a given finite field Fp.