Finite Field Implementations
A Study Club Talk
Algorithms for Fast Multiplication and Modular Reduction
If something isn’t clear, ask.
You can use the “raise hand” button or the chat window, but feel free to interrupt
Flashback… Intro to Finite Fields
Motivation
Why Finite Fields?
Implementations for Real Computers
Why is Speed Important?
Overview
In this study club we are going to talk about:
Big Integers
A.k.a BigInt or Multiprecision Integers
BigInt
BigInt
BigInt
BigInt Addition
BigInt Addition
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
BigInt Multiplication
BigInt Multiplication
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
BigInt Multiplication
Modular Reduction
Modular Reduction
Barrett Reduction
From the Wikipedia (Barrett Reduction)
def reduce(u uint) uint {
q := u / N # Division implicitly returns the floor of the result.
return u - q * N # N is the modulus
}
Barrett Reduction
From the Wikipedia (Barrett Reduction)
def mostly_reduce(a uint) uint {
q := (u * R) >> 2*n # ">> 2*n" denotes bitshift by 2*n.
return u - q * N
}
Barrett Reduction
From the Wikipedia (Barrett Reduction)
def reduce(a uint) uint {
q := (u * R) >> 2*n
u -= q * N # Reduce to an approximate answer.
while u >= N { # Final few additions to get fully-reduced answer.
u -= N
}
return u
}
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
Montgomery Form
Montgomery Form
Montgomery Reduction
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
Montgomery Reduction
Montgomery Multiplication and Reduction
From the Handbook of Elliptic and Hyperelliptic Curve Cryptography
A Quick Comparison of Finite Field Multiplication
Additional Multiplication Methods
Thanks for coming!
Feel free to ask any more questions!