Next: Randomness functions, Previous: Divisor arithmetic, Up: Preface
G2HEC exports several functions to output of polynomials, curves and divisors. They might be more useful for mathematics research on genus 2 curves over finite fields than for implementation of cryptographic protocols. For sake of completeness, we briefly introduce them here.
void print_poly(poly_t& poly, std::ostream *s): 
directs a natural representation of polynomial poly to s. 
For example, calling print_poly(f, cout) will display in the standard
output
x^5 + 3*x^2 + x
if f is a poly_t object representing 
f(x) = x^5 + 3 x^2 + x.
Calling cout << curve;  will display in the standard output 
something like
Curve: y^2 + h(x)*y = f(x)
       h(x) = 0
       f(x) = x^5 + 1
       Genus 2 curve is nonsingular
if curve is a valid genus 2 curve, or 
Curve: y^2 + h(x)*y = f(x)
       h(x) = 0
       f(x) = x^2
       Curve is singular, or not genus 2, or f(x) is not monic
if curve is not valid.
Calling cout << divisor;  will display in the standard output
something like
###
Divisor [u(x), v(x)] for Jacobian group of curve y^2 + h(x)*y = f(x).
Curve: y^2 + h(x)*y = f(x)
       h(x) = 0
       f(x) = x^5 + 1
       Genus 2 curve is nonsingular
[u(x), v(x)]:
       u(x) = 1
       v(x) = 0
       Divisor is valid
###
if divisor is a valid divisor, or
###
Divisor [u(x), v(x)] for Jacobian group of curve y^2 + h(x)*y = f(x).
Curve: y^2 + h(x)*y = f(x)
       h(x) = 0
       f(x) = x^5 + 1
       Genus 2 curve is nonsingular
[u(x), v(x)]:
       u(x) = 1
       v(x) = x
       Divisor is invalid
###
if divisor is not valid.