Appendix B. Hilbert class polynomials
This appendix explains how the book generates the Hilbert class polynomials needed when searching for pairing-friendly elliptic curves. These polynomials are part of the complex multiplication approach introduced earlier in the book, where the key step is solving for a curve’s j-invariant through the relevant class polynomial.
The code shown is a short PARI/GP program that loops through a selected set of discriminants and writes the corresponding Hilbert class polynomials to a file. The chosen discriminants are negative values congruent to 3 mod 4, covering the range from 7 to 163 in steps that match the values used elsewhere in the book’s curve-generation routines. The appendix notes that this range is enough for the book’s examples, but the method could be extended further.
The output file contains the polynomials in their raw integer form, before any reduction modulo a prime. This means the results are not immediately tied to a specific finite field, but become useful once a prime is chosen for the curve construction process. The appendix then provides a sample output file, illustrating that the resulting polynomials vary in degree and size depending on the discriminant, with many coefficients becoming quite large.
FAQ
What is the purpose of generating Hilbert class polynomials in this appendix?
The appendix provides code to generate Hilbert class polynomials used in the book to help find pairing-friendly elliptic curves. These polynomials are part of the complex multiplication method, which is used to solve for the j-invariant of a curve.How are Hilbert class polynomials used in the complex multiplication method?
In the complex multiplication method, one uses Hilbert class polynomials to find valid j-invariants. Those j-invariants are then used to construct pairing-friendly curves.What range of discriminants does the appendix use?
The discriminants used in the appendix are all congruent to 3 mod 4 and range from 7 to 163. The text also notes that there is no reason the method must stop at 163.What values of D are generated by the PARI loop in the code?
The code loops over the values 7, 11, 15, 19, and 23, and then adds multiples of 20 for a from 0 to 7. It negates each value before passing it topolclass().What PARI function is used to compute the Hilbert class polynomial?
The code uses the PARI/GP functionpolclass() to compute the Hilbert class polynomial for each discriminant D.Why does the code store negative values of D?
The code setsD = stoi(-(atab[i] + j*20)) because Hilbert class polynomials are computed using negative discriminants in this context.
Elliptic Curve Cryptography for Developers ebook for free