Merge pull request #55 from paritytech/add-note

Add source for externsion field algo
This commit is contained in:
Nikolay Volf 2019-03-18 20:02:36 +03:00 committed by GitHub
commit 4eb92627ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -98,6 +98,8 @@ fn fq_sqrt(a: Fq) -> Option<Fq> {
}
}
// Algorithm 9 Square root computation over Fq2, with q ≡ 3 (mod 4)
// from https://eprint.iacr.org/2012/685.pdf (Square root computation over even extension fields)
fn fq2_sqrt(a: Fq2) -> Option<Fq2> {
let a1 = a.pow(FQ_MINUS3_DIV4.into_u256());
let a1a = a1 * a;