<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Modulo Errors &#187; Group Theory</title>
	<atom:link href="http://maths.straylight.co.uk/archives/category/group-theory/feed" rel="self" type="application/rss+xml" />
	<link>http://maths.straylight.co.uk</link>
	<description>for when the margin is too small</description>
	<lastBuildDate>Thu, 12 Jan 2012 16:36:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Christmas Doodling</title>
		<link>http://maths.straylight.co.uk/archives/334</link>
		<comments>http://maths.straylight.co.uk/archives/334#comments</comments>
		<pubDate>Wed, 29 Dec 2010 17:25:04 +0000</pubDate>
		<dc:creator>Graeme</dc:creator>
				<category><![CDATA[Group Theory]]></category>
		<category><![CDATA[Pop.Maths]]></category>
		<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://maths.straylight.co.uk/?p=334</guid>
		<description><![CDATA[After watching Vi Hart&#8216;s latest video I found myself thinking about patterns, because I&#8217;m the weird sort of number theorist who&#8217;s more interested in general structures than specific instances like actual numbers. Because I&#8217;m doubly weird, I tend to doodle with computer code rather than pen and paper, so over the christmas break I cobbled [...]]]></description>
			<content:encoded><![CDATA[<p>After watching <a href="http://vihart.com/">Vi Hart</a>&#8216;s <a href="http://www.youtube.com/watch?v=Yhlv5Aeuo_k">latest video</a> I found myself thinking about patterns, because I&#8217;m the weird sort of number theorist who&#8217;s more interested in general structures than specific instances like actual numbers. Because I&#8217;m doubly weird, I tend to doodle with computer code rather than pen and paper, so over the christmas break I cobbled together a toy to explore some colourings of Pascal&#8217;s Triangle:</p>
<div class="processing_embed" id="doodle_groups2_container"><p><a href="#" onclick="deployJava.addAppletTo('doodle_groups2', 'http://maths.straylight.co.uk/processing/doodle_groups2.jar', 640, 480, 'http://maths.straylight.co.uk/wp-content/plugins/wordpress-processing-embed', 'doodle_groups2_container'); return false;">Load the applet</a></p></div>
<p>The default is as Vi illustrated, where each dot has one of three colours. At no point do I bother to calculate values in Pascal&#8217;s triangle to work out a colour: instead, I implemented the  &#8216;group law&#8217; &#8211; the rule that combines pairs of dots into a new dot &#8211; and used that to find each new dot based on its parents above it. This underlying group structure is the same as Vi&#8217;s drawing, except the colours are different: you could write down a rule for changing my colours into hers and applying it consistently would recover her sketch. That probably doesn&#8217;t seem too surprising: what&#8217;s more remarkable is that <em>any</em> group of three elements is, in the most abstract sense, the same as these: which is why the original approach, of taking remainders modulo 3, also corresponds perfectly to manipulating coloured dots directly instead of numbers. </p>
<p>There&#8217;s nothing special about having three colours, so I&#8217;ve included the option to have anything from two to eight: no reason to stop there, except I was struggling to come up with non-garish palettes! These are all examples of cyclic groups: if you keep applying the group law you cycle through each colour before coming back to the first one and repeating. But not all groups are cyclic, so I wondered what would happen if I picked a group that wasn&#8217;t. For instance, with four colours you can write down two equally valid yet inequivalent group laws: the cycle on four colours, or the <em>Klein four-group</em><sup>1</sup> which combines two copies of the cycle on two elements. But when I tried to plot that, I just got a two-coloured diagram, not four: I was trapped in the smaller <em>subgroup</em>. Similarly, you can make a group of six elements by considering symmetries of an equilateral triangle: from that I could recover either the two or three colour plots. </p>
<p>In fact, this limitation will always apply when the triangle is grown from a single seed, and all the surrounding dots are assumed to be the &#8216;zero&#8217; or <em>identity</em> colour. Each seed will generate a <em>cycle</em> of some length, and the picture you get will only include colours from that cycle, not the entire palette: except for the happy cases where you picked a cyclic group and a <em>generator</em> as the seed<sup>2</sup>. I tried lopping off the top dot, so that the &#8216;triangle&#8217; could be grown from the interaction of two elements, but the results tended to be ugly: you lose symmetry, which is always a disappointment when playing with groups! </p>
<p><sup>1</sup> <small>Which uncoincidentally happens to be the name of <a href="http://www.youtube.com/user/kleinfour">this</a> group of mathemusicians!</small><br />
<sup>2</sup> <small> Exercise for undergrads: prove this <img src='http://maths.straylight.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </small></p>
]]></content:encoded>
			<wfw:commentRss>http://maths.straylight.co.uk/archives/334/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Colloquium Talk</title>
		<link>http://maths.straylight.co.uk/archives/123</link>
		<comments>http://maths.straylight.co.uk/archives/123#comments</comments>
		<pubDate>Fri, 31 Oct 2008 11:19:20 +0000</pubDate>
		<dc:creator>Graeme</dc:creator>
				<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Group Theory]]></category>
		<category><![CDATA[PhD]]></category>
		<category><![CDATA[Talks]]></category>

		<guid isPermaLink="false">http://maths.straylight.co.uk/?p=123</guid>
		<description><![CDATA[Slides from a colloquium I gave on public key cryptography.]]></description>
			<content:encoded><![CDATA[<p>Yesterday I gave another <a href="http://www.maths.ed.ac.uk/~s0681349/PGActivities/colloquium.shtml">postgraduate colloquium</a>, on the basics of public key cryptography. The slideshow I used is <a href="http://www.maths.ed.ac.uk/~s0677951/crypto_colloquium.pdf">here</a> [pdf], although obviously it&#8217;s missing the narrative to go with it. The first part, on sharing secret colours, was lifted from the talk described <a href="http://maths.straylight.co.uk/archives/108">here</a>, although I discussed the discrete logarithm problem in group-theoretic terms this time.  </p>
]]></content:encoded>
			<wfw:commentRss>http://maths.straylight.co.uk/archives/123/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geometry Club Talk: Computational aspects of ECDLP</title>
		<link>http://maths.straylight.co.uk/archives/118</link>
		<comments>http://maths.straylight.co.uk/archives/118#comments</comments>
		<pubDate>Wed, 23 Apr 2008 09:05:35 +0000</pubDate>
		<dc:creator>Graeme</dc:creator>
				<category><![CDATA[Algebraic Geometry]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Complexity]]></category>
		<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Group Theory]]></category>
		<category><![CDATA[PhD]]></category>
		<category><![CDATA[Talks]]></category>

		<guid isPermaLink="false">http://maths.straylight.co.uk/?p=118</guid>
		<description><![CDATA[Notes from my geometry club talk given April 18th, 2008.]]></description>
			<content:encoded><![CDATA[<p>On Friday I gave a <a href="http://www.maths.ed.ac.uk/~s0198576/gc/">geometry club</a> seminar, speaking about some of the computational aspects of discrete-logarithm cryptography in general and as implemented for elliptic curves.  <a href="http://www.maths.ed.ac.uk/~s0677951/gc_apr_08.pdf">My notes</a> supplement rather than completely describe the talk, being heavier on the formalities and lighter on the narrative. </p>
<p>The topics covered are: Diffie-Hellman and one-way functions for key exchange; the generic Discrete Logarithm Problem and BSGS algorithm; scalar multiplication- addition chains, fast exponentiation, m-ary methods and windowing; group law implementations, Side-channel attacks and the Edwards form. </p>
<p>I&#8217;ve discussed several of these ideas elsewhere on this blog, as well as the cryptanalysis ideas I mentioned on the day but which are not in the notes. I also refered to a recent real-world example of a side-channel attack; see <a href="http://www.theregister.co.uk/2008/04/03/keeloq_master_key_found/">this</a> story from The Register for details.</p>
]]></content:encoded>
			<wfw:commentRss>http://maths.straylight.co.uk/archives/118/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Year Presentation</title>
		<link>http://maths.straylight.co.uk/archives/88</link>
		<comments>http://maths.straylight.co.uk/archives/88#comments</comments>
		<pubDate>Mon, 11 Jun 2007 19:12:16 +0000</pubDate>
		<dc:creator>Graeme</dc:creator>
				<category><![CDATA[Algebra]]></category>
		<category><![CDATA[Algebraic Geometry]]></category>
		<category><![CDATA[Group Theory]]></category>
		<category><![CDATA[Number Theory]]></category>
		<category><![CDATA[PhD]]></category>
		<category><![CDATA[Talks]]></category>

		<guid isPermaLink="false">http://maths.straylight.co.uk/?p=88</guid>
		<description><![CDATA[Slides and Report from my first year presentation on the point counting problem.]]></description>
			<content:encoded><![CDATA[<p>Tomorrow I give my first year presentation, which determines whether I&#8217;m allowed to continue my studies. At 20-30 minutes, it&#8217;s a rather condensed version of my recent geometry club talk on the point counting problem, although this time I&#8217;m skipping more quickly through the fundamentals so that I can discuss some of the algorithms in depth, and taking a (hopefully) clearer route. </p>
<p>Both <a href="http://www.maths.ed.ac.uk/~s0677951/y1report.pdf">the report itself</a> and <a href="http://www.maths.ed.ac.uk/~s0677951/y1talk.pdf">the OHP slides</a> version are available (pdf).  Content covered: hyperelliptic curves, points, divisors, mumford polynomials and the Picard group/Jacobian; the discrete logarithm problem; explicit group law computation; characteristic polynomial of Frobenius and Weil theorems/interval; group-theoretic approaches; Schoof&#8217;s algorithm, SEA in genus 1,  genus 2 hybrid algorithms.</p>
]]></content:encoded>
			<wfw:commentRss>http://maths.straylight.co.uk/archives/88/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Genus 2 jacobian group law in Maple</title>
		<link>http://maths.straylight.co.uk/archives/80</link>
		<comments>http://maths.straylight.co.uk/archives/80#comments</comments>
		<pubDate>Wed, 18 Apr 2007 11:32:32 +0000</pubDate>
		<dc:creator>Graeme</dc:creator>
				<category><![CDATA[Algebraic Geometry]]></category>
		<category><![CDATA[Group Theory]]></category>
		<category><![CDATA[Maple]]></category>
		<category><![CDATA[Number Theory]]></category>
		<category><![CDATA[PhD]]></category>

		<guid isPermaLink="false">http://maths.straylight.co.uk/archives/80</guid>
		<description><![CDATA[Maple procedures for working with the group of rational divisors of a genus 2 hyperelliptic curve; designed for compatibility with generic_group procedures.]]></description>
			<content:encoded><![CDATA[<p><strong>Update 4/v/07: I&#8217;ve switched from Cantor&#8217;s definitions for a curve of the form y<sup>2</sup>=f(x) to a more general form, following   the notation of a paper by Tanja Lange; that also describes many efficiency gains for these calculations, none of which I have yet adopted&#8230; I&#8217;m also implementing these procedures in SAGE, which seems a more natural environment. So consider all genus 2 stuff as work in progress!</strong></p>
<p><a href="http://www.maths.ed.ac.uk/~s0677951/jac.mpl"><tt>jac</tt></a> is an implementation of the group law on the jacobian of a genus 2 hyperelliptic curve over a finite field, to work with the <a href="http://www.maths.ed.ac.uk/~s0677951/generic_group.mpl"><tt>generic_group</tt></a> procedures described <a href="http://maths.straylight.co.uk/archives/74">previously</a>. Standard version is for Maple 10; you can also get <a href="http://www.maths.ed.ac.uk/~s0677951/jac9.mpl">a version</a> for Maple 9, but this may not be updated as frequently.</p>
<p>An arbitrary divisor D is now either a list [a(u),b(u)] or the identity element <tt>zero</tt>. Addition of two such divisors D,E is given by <tt>g2JacGroupLaw(D,E)</tt> whilst <tt>g2JacMinus(D)</tt> gives the inverse. So these functions can be used as arguments for <tt>ncopies</tt> and so on. To set up the worksheet, specify a characteristic p; a degree five monic squarefree polynomial f(u) and a polynomial h(u) of degree at most 2. Only rational divisors and prime fields seem to work: working mod p generates sufficiently ugly Maple code to discourage me from trying extension fields there.</p>
<p>Also included are a couple of ways to get random divisors to compute with. <tt>randomDiv</tt> is incredibly slow as it naively tests random choices of a (monic quadratic) and b (linear) for suitability (that is, a dividing b^2+bh-f). <tt>randPoint(f,h)</tt> is smarter (transforming to y<sup>2</sup>=g(x), using the legendre symbol to test random choices of x for square g(x) then finding a root and transforming back to a suitable y) and of course you can combine two points into a weight 2 divisor using the group law.</p>
<p>Order computation, even with BSGS, becomes very slow for less than staggering values of p: this is of course the point cryptographically! For instance, it took my university workstation about 11 hours to find the order of a randomly constructed divisor from a curve over a field with around a hundred-thousand elements. </p>
]]></content:encoded>
			<wfw:commentRss>http://maths.straylight.co.uk/archives/80/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Computation in the jacobian of hyperelliptic curves</title>
		<link>http://maths.straylight.co.uk/archives/79</link>
		<comments>http://maths.straylight.co.uk/archives/79#comments</comments>
		<pubDate>Wed, 18 Apr 2007 09:45:52 +0000</pubDate>
		<dc:creator>Graeme</dc:creator>
				<category><![CDATA[Algebraic Geometry]]></category>
		<category><![CDATA[Group Theory]]></category>
		<category><![CDATA[Number Theory]]></category>
		<category><![CDATA[PhD]]></category>

		<guid isPermaLink="false">http://maths.straylight.co.uk/?p=79</guid>
		<description><![CDATA[Polynomial representation of divisors and the notion of rationality.]]></description>
			<content:encoded><![CDATA[<p>Last time I introduced the idea of divisors on a curve; but an observant reader may have noticed that along the way the idea of rational points seemed to be lost. Further, whilst the Riemann-Roch theorem guarantees that a divisor from the jacobian will have a reduced representative, no indication was given as to how that representative is to be found. In this post I&#8217;ll try to clear up both of these issues.
</p>
<p>
Recall that a semi-reduced divisor D from the jacobian takes the form (&Sigma;<sub>i</sub><sup>r</sup>P<sub>i</sub>) &#8211; r&infin; where the P<sub>i</sub> are points (x<sub>i</sub>,y<sub>i</sub>) of C. We will represent this by a pair of polynomials D=div(a(u),b(u)) with the following properties:</p>
<p align=center><img src="http://straylight.co.uk/cgi-bin/mimetex.cgi?a(u)=\prod_i^r (u-x_i)"/></p>
<p align=center><img src="http://straylight.co.uk/cgi-bin/mimetex.cgi?b(x_i)=y_i\,\,1\leq i \leq r"/></p>
<p>such that b has degree less than that of a, and the appropriate multiplicity for repeated points- i.e., if P<sub>i</sub> occurs k times in the semi-reduced representation of D, then (u-x<sub>i</sub>)<sup>k</sup> divides b-y<sub>i</sub>. This ensures uniqueness.</p>
<p>
The empty divisor (zero element of the jacobian) is denoted by div(1,0); if a is linear (and hence b constant) then the divisor corresponds to a single point of C; for the point (x,y) the divisor is div(u-x,y). The degree of a is described as the weight; &#8216;most&#8217; reduced divisors will be of weight g.  Recall that the co-ordinates of a point were only required to be in A rather than K; we describe a divisor as rational over K if the coefficients of a and b are from K. Beware that a rational divisor may therefore be the sum of points which are not K-rational points of the curve; however, a weight 1 rational divisor obviously corresponds to a K-rational point.
</p>
<p>
The K-rational principal divisors of C are a subgroup of <b>P<sub>0</sub></b> and their image in J, J<sub>K</sub>, the subgroup of rational divisors of the Jacobian, is the object of computational interest. The K-rational points of C are then identified with a subset of J<sub>K</sub>; namely the divisors of weight at most 1; except in genus 1 (where they are J<sub>K</sub>), this isn&#8217;t a subgroup due to the lack of closure.
</p>
<p>
So we wish to work with rational divisors from J<sub>K</sub>.Given such divisors of the form div(a,b), it is undesirable to construct their sum by &#8216;unpacking&#8217; the points P<sub>i</sub> and forming new polynomials as the co-ordinates (roots of a, evaluations of b) might not be from K but A. Fortunately, it is also unnecessary: the only complications are connected to repeated points or the combination of a point and its negative; careful manipulation of gcds allows for direct computation of the semi-reduced form. See <sup>1</sup> for details, which also describes moving from semi-reduced to reduced form. To do this, note that for a divisor D=div(a,b), the divisor E=-((b-v)-D)=div(a&#8217;,b&#8217;) is equivalent to D with deg(a&#8217;)=max(2g+1,2)-deg(a); thus by repeated iteration we can move to a reduced representative (the explicit formulae are a&#8217;=(f-b<sup>2</sup>)/a, b&#8217;=-b mod a&#8217;).
</p>
<p>Maple procedures to do all this will be provided in the next post.</p>
<p>
<strong>Reference</strong><br />
<sup>1</sup><i>Computing in the Jacobian of a Hyperelliptic Curve</i> D.Gantor Mathematics of Comptuation Vol.48.No.177 (Jan., 1987).</p>
]]></content:encoded>
			<wfw:commentRss>http://maths.straylight.co.uk/archives/79/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>From points to divisors:  the jacobian.</title>
		<link>http://maths.straylight.co.uk/archives/78</link>
		<comments>http://maths.straylight.co.uk/archives/78#comments</comments>
		<pubDate>Tue, 17 Apr 2007 15:19:42 +0000</pubDate>
		<dc:creator>Graeme</dc:creator>
				<category><![CDATA[Algebraic Geometry]]></category>
		<category><![CDATA[Group Theory]]></category>
		<category><![CDATA[Number Theory]]></category>
		<category><![CDATA[PhD]]></category>

		<guid isPermaLink="false">http://maths.straylight.co.uk/?p=78</guid>
		<description><![CDATA[Extending the idea of the group of rational points of an elliptic curve to higher genus: the jacobian of a hyperelliptic curve.]]></description>
			<content:encoded><![CDATA[<p>One of the most celebrated properties of elliptic curves is that the set of rational points is a group, with a highly geometric explanation of the group law: the &#8216;chord and tangent&#8217; process. Two points and their sum are linked by consideration of the intersection of straight lines with the curve: as the curve is a cubic, there are three intersections (subject to some technical book-keeping with repeated points and the point &#8216;at infinity&#8217;). Such an approach clearly won&#8217;t transfer immediately to curves given by higher degree polynomials, as there will be more intersections, but as there are only finitely many, one would still hope to be able to define relationships between points. For instance, on an elliptic curve, if A, B and &infin; are colinear then B is -A; thus if on a more complicated curve we had A,B,C,&infin; colinear it might make sense to think of C as -(A+B), and then A+C as -B and so on. That is to say, there may be relationships between groups of points rather than individual points.
</p>
<p>
In algebraic geometry, this (and much more) is captured by the notion of a divisor; rather than present them here in full generality, I will consider the specific case of divisors on (hyperelliptic) curves. These will then serve as the building blocks for a group structure connected to the curve which reduces in the special case of an elliptic curve to the familiar group of rational points.
</p>
<p>
To fix ideas, let K be a field of characteristic other than 2 with algebraic closure A. A curve C is described as a hyperelliptic curve of genus g if there is some degree 2g+1 polynomial f with distinct roots such that v<sup>2</sup>=f(u) is a model of C: so the familiar elliptic curves are the special cases with genus 1.
</p>
<p>
A point P on C is a pair (x,y) of elements of A (not K) satisfying y=f(x); or the point at infinity &infin;. Then a divisor D of C is a finite formal sum &Sigma;<sub>i</sub>m<sub>i</sub>P<sub>i</sub> for integers m<sub>i</sub> and points P<sub>i</sub> on C.  D is described as having degree &Sigma;<sub>i</sub>m<sub>i</sub>; if all the m<sub>i</sub>&ge;0 then we write D&ge;0. Formal (that is, pointwise) addition of divisors gives the additive group <b>D</b> of divisors; its identity is the divisor consisting of summing no points and it has  a subgroup <b>D<sub>0</sub></b> consisting of divisors with degree zero.
</p>
<p>
Any polynomial p(u,v) can be considered as a function on C of the form p=a(u)+b(u)v, since v<sup>2</sup>=f(u). If p vanishes at (x,y) then the order of the zero (x,y) of p is the exponent of the highest power of (u-x) which divides a<sup>2</sup>-b<sup>2</sup>f.
</p>
<p>
Thus we can define functions on C as h=p/q for p,q polynomials from K[u,v] such that v<sup>2</sup>-f(u) does not divide q(u,v): that is, q is not everywhere zero on C. Then h will have a finite set of zeros (those of p) and of poles (those of q); we associate to h a divisor, (h) = &Sigma;<sub>i</sub>m<sub>i</sub>P<sub>i</sub> where the P<sub>i</sub> are those zeros and poles and m<sub>i</sub> their multiplicities:
</p>
<p align=center><img src="http://straylight.co.uk/cgi-bin/mimetex.cgi?(h)=\displaystyle\sum_{\mbox{zeros of } p} ord_{P_i}(p)P_i - \displaystyle\sum_{\mbox{zeros of } q} ord_{P_i}(q)P_i"/></p>
<p>
If there is a nonzero function h on C such that D a divisor is (h), then D is described as principal. the principal divisors form a subgroup <b>P</b> of <b>D<sub>0</sub></b> and hence <b>D</b>: the jacobian J of C is then the quotient <b>D<sub>0</sub>/</b><b>P</b>. That is, two divisors correspond to the same element of the jacobian if they differ by a principal divisor. This gives some idea as to how to simplify arbitrary divisors- we work in the jacobian and seek a simplest representative; that is, one comprised of the minimal number of points.
</p>
<p>
Consider that if (x,y) is a point P of C, then so is P&#8217;=(x,-y). The function u-x has zeros P and P&#8217; with a double pole at &infin; so P+P&#8217;+&infin; = (u-x) is principal and hence equivalent to zero mod <b>P</b>.   Hence -P&#8217; is equivalent to P-2&infin; so we can rewrite divisors to only feature positive multiples of points other than &infin; Thus in J, where the degree is necessarily 0, any element has a representation
</p>
<p align=center><img src="http://straylight.co.uk/cgi-bin/mimetex.cgi?D=\left\(\displaystyle\sum_{i=1}^r P_i\right\) - r\infty"/></p>
<p>such that if P<sub>i</sub> appears in D, then no P<sub>j</sub>=P&#8217; for any j different to i. Hence, any point of the form (x,0) will appear at most once. Such a representation is called semi-reduced; if r&le;g then it is called reduced.
</p>
<p>
Remarkably, (by the Riemann-Roch theorem) any divisor in the Jacobian will have a unique, reduced representative (in other words, any divisor is the sum of a reduced divisor and a principal divisor). Now we can see what&#8217;s really going on with the elliptic curve group law: as a reduced divisor will have r&le;1, it takes the form P-&infty; so there is an obvious isomorphism between the set of rational points and the Jacobian. Hence adding two points A,B on the curve gives rise to another point of the curve, by reducing the divisor A+B-2&infin; to some representative C-&infin; and setting A+B=C.
</p>
<p>
But with hyperelliptic curves, this needn&#8217;t be the case: the sum of two points is a perfectly good reduced divisor in the next simplest case of genus 2, for instance, so we can&#8217;t add two points and expect the answer to be a point. Hence we need to consider the divisors corresponding to rational points in the broader setting of the jacobian; to extract useful information about those points, we&#8217;ll need to consider the rational divisors. This motivates an alternative notation for divisors, more suitable to computation: I leave all these issues to the next post.</p>
]]></content:encoded>
			<wfw:commentRss>http://maths.straylight.co.uk/archives/78/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Elliptic Curve group law in Maple</title>
		<link>http://maths.straylight.co.uk/archives/75</link>
		<comments>http://maths.straylight.co.uk/archives/75#comments</comments>
		<pubDate>Tue, 03 Apr 2007 11:23:43 +0000</pubDate>
		<dc:creator>Graeme</dc:creator>
				<category><![CDATA[Algebraic Geometry]]></category>
		<category><![CDATA[Group Theory]]></category>
		<category><![CDATA[Maple]]></category>
		<category><![CDATA[Number Theory]]></category>
		<category><![CDATA[PhD]]></category>

		<guid isPermaLink="false">http://maths.straylight.co.uk/archives/75</guid>
		<description><![CDATA[Maple procedures for working with the group of rational points of an elliptic curve; designed for compatibility with generic_group procedures.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.maths.ed.ac.uk/~s0677951/ella.mpl"><tt>ella</tt></a> is an update of <tt>gla</tt>, the elliptic curve group law procedures, to work with the <a href="http://www.maths.ed.ac.uk/~s0677951/generic_group.mpl"><tt>generic_group</tt></a> procedures described <a href="http://maths.straylight.co.uk/archives/74">previously</a>.</p>
<p>An arbitrary point P is now either a list [x,y] or the identity element <tt>zero</tt>. Addition of two such points P,Q is given by <tt>ellGroupLaw(P,Q)</tt> whilst <tt>ellMinus(P)</tt> gives the inverse. So these functions can be used as arguments for <tt>ncopies</tt> and so on. Setting up the curve <a href="http://maths.straylight.co.uk/archives/54">is</a> <a href="http://maths.straylight.co.uk/archives/55">as</a> <a href="http://maths.straylight.co.uk/archives/56">described</a> for <tt>gla</tt>: specify variables <i>a_1</i> through <i>a_6</i> and optionally set <tt>workModM</tt> and a modulus <i>M</i> for computation over prime fields.  The <tt>getQuantities</tt> function is also included for convenience; order calculations and functions like the old  <tt>mnadd</tt> should make use of the <tt>generic_group</tt> procedures and thus are omitted.</p>
<p>I&#8217;m keeping <tt>gla</tt> available for use with <tt>torsion_tools</tt>, most of the functions of the latter depend strongly on the underlying group being that of an elliptic curve so cannot be translated to generic form, so I can&#8217;t be bothered to update the notation from x,y to [x,y] ! </p>
]]></content:encoded>
			<wfw:commentRss>http://maths.straylight.co.uk/archives/75/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Abstract group operations in Maple</title>
		<link>http://maths.straylight.co.uk/archives/74</link>
		<comments>http://maths.straylight.co.uk/archives/74#comments</comments>
		<pubDate>Tue, 03 Apr 2007 10:23:49 +0000</pubDate>
		<dc:creator>Graeme</dc:creator>
				<category><![CDATA[Group Theory]]></category>
		<category><![CDATA[Maple]]></category>
		<category><![CDATA[PhD]]></category>

		<guid isPermaLink="false">http://maths.straylight.co.uk/?p=74</guid>
		<description><![CDATA[Maple procedures for order finding, DLP and multiplication by m in an abstract group]]></description>
			<content:encoded><![CDATA[<h3>Overview</h3>
<p>For the last month or so I&#8217;ve been working with hyperelliptic rather than elliptic curves. This requires working in the Jacobian of the curve rather than the curve itself, but the basic computational tasks are of course the same: adding arbitrary points, multiplication by m, finding orders. I wrote Maple code for all of these in the elliptic curve case, but the simplicity of both the group law and the examples I worked on meant I could get away with brute force computation of these. But for higher genus (even genus 2), this becomes crippling very early on, so I needed some smarter methods. Having discovered that you can pass functions as arguments in Maple, it seemed best to divorce the group methods from the specifics of the group being computed with. To that end, I present <a href="http://www.maths.ed.ac.uk/~s0677951/generic_group.mpl"><tt>generic_group</tt></a>, a set of Maple procedures for generic group algorithms.</p>
<p>A generic algorithm is one which only performs the group operation, inversion, or testing for equality. To that end, these procedures may take as arguments: elements; a function <tt>grouplaw</tt> that performs the group operation on an input of two elements; or another function <tt>groupminus</tt> that inverts its input element.  Since I&#8217;m usually working with additive groups, the neutral element is given as <tt>zero</tt>, and so the supplied functions must be able to handle this.</p>
<p>The idea is that other sets of procedures will specify those functions: for instance, I&#8217;ve been writing procedures for the group of divisors of an algebraic curve: as a special case I have a function <tt>g2JacGroupLaw</tt> which will sum two rational divisors from the Jacobian of a genus 2 hyperelliptic curve. Rather than writing a multiplication by m function for such divisors, I just plug that function into the generic procedure for finding n copies of an element. I&#8217;ve updated <a href="http://maths.straylight.co.uk/archives/54">my earlier elliptic curve procedures</a> to this format as well.</p>
<h3>The Procedures</h3>
<h4>Multiplication by n (<tt>ncopies</tt> and <tt>brutencopies</tt>)</h4>
<p>A call of <tt>ncopies(n,g,grouplaw,groupminus)</tt> computes [n]g; it catches the special cases of n=0 (giving <tt>zero</tt>), n=1 (giving g) and n negative (giving [|n|](-g)). <br />This procedure uses around 2ceil(log<sub>2</sub>n) instances of the group law by exploiting fast exponentiation, rather than naively adding successive terms. If out of boredom or to compare performance you want naive addition, you can use <tt>brutencopies(n,G,grouplaw,groupminus)</tt> instead.  </p>
<h4>Discrete Logarithm Problem (<tt>BSGSDL</tt>)</h4>
<p>In <a href="http://maths.straylight.co.uk/archives/73">the previous post</a> I described the Baby Step, Giant Step algorithm for computing discrete logarithms, in the case of unknown order of the generator (Terr&#8217;s variant). <tt>BSGSDL(g,h,grouplaw)</tt> will use this to return an integer t such that [t]g=h; this assumes that there is such a t, i.e., that h is in &lt;g&gt;. beware that if it isn&#8217;t, the procedure will wander off to deep space and never terminate.</p>
<h4>Order finding (<tt>BSGSOrder</tt> and <tt>bruteOrder</tt>)</h4>
<p>Terr&#8217;s variant can be used to establish the order of an element by solving the DLP with h=<tt>zero</tt>; however you have to check that g itself is not the identity first. So <tt>BSGSOrder(g,grouplaw)</tt> will find the least t such that [t]g=<tt>zero</tt>. If you want to try this by checking successive multiples of g, you can use <tt>bruteOrder(g,grouplaw)</tt> instead; again, knowing nothing about the group neither of these procedures knows when to give up so can churn forever if g is of infinite order.</p>
]]></content:encoded>
			<wfw:commentRss>http://maths.straylight.co.uk/archives/74/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Baby Steps, Giant Steps, and element orders</title>
		<link>http://maths.straylight.co.uk/archives/73</link>
		<comments>http://maths.straylight.co.uk/archives/73#comments</comments>
		<pubDate>Mon, 02 Apr 2007 16:53:30 +0000</pubDate>
		<dc:creator>Graeme</dc:creator>
				<category><![CDATA[Algebraic Geometry]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Cryptology]]></category>
		<category><![CDATA[Group Theory]]></category>
		<category><![CDATA[Number Theory]]></category>
		<category><![CDATA[PhD]]></category>

		<guid isPermaLink="false">http://maths.straylight.co.uk/?p=73</guid>
		<description><![CDATA[Establishing the order of an element by BSGS.]]></description>
			<content:encoded><![CDATA[<p>The discrete logarithm problem is the vital part of elliptic curve cryptography, but can be defined (to varying cryptographic strength) for any cyclic group:  </p>
<blockquote><p><strong>Discrete Logarithm Problem (DLP)</strong><br />
Let G be a cyclic group, with operation &oplus;.  Let [n] represent (n-1)-fold application of &oplus; i.e., [2]g=g&oplus;g, [3]g=g&oplus;g&oplus;g etc.<br />
<br />
Given g,h from G, the discrete logarithm problem is to find t such that [t]g=h.</p>
</blockquote>
<p>The baby-step, giant step (BSGS) algorithm is a generic algorithm for solving the DLP- that is to say, it makes no appeal to properties of the group involved, merely calculating abstractly with &oplus;.  There is a theoretical upper bound to the effectiveness of generic algorithms, and BSGS approaches are of that order of magnitude. </p>
<p>The simplest demonstration of BSGS (the original by Shanks) assumes that g generates G, with both of known order n: recall that the group order is simply the number of elements it contains, whereas the order of an element g is the least n such that [n]g=id<sub>G</sub>, should such a value exist. The order n of an element always divides the order of the group N, with equality when g generates G.  Between the two there is also the exponent, the least value e such that [e]g=id<sub>G</sub> for all g in G; for cyclic groups this is N, but for products of cyclic groups (the structure of groups of rational points) it is the lowest common multiple of their respective orders, and thus, although a divisor of N, may be significantly smaller than it.</p>
<p>So, if we can find an order m rational point on a curve, we know that the cardinality of the group of rational points is zero modulo m. By testing random points and taking the lowest common multiple of their order we can usually find the exponent e of the group. With luck, but not always, this will be large enough that when combined with bounds on the cardinality the latter is established exactly (as with modular information in the SEA algorithm). </p>
<p>But it is no good attempting to do so using an algorithm that requires the order of the point! There are BSGS algorithms for the DLP which can handle unknown order, for a given g we can apply these to solve for h=id<sub>G</sub> in the cyclic group generated by g. Provided the algorithm gives the minimal t such that [t]g=h=id<sub>G</sub> in G=&lt;g&gt;, then t is the order of g. </p>
<p>One such algorithm, by Terr, is given in Cohen and Frey&#8217;s <i>Handbook of Elliptic and Hyperelliptic curve cryptography</i> (my current bible!) It relies on the following observation:</p>
<blockquote><p>
<p>Let T<sub>n</sub> be the <em>n</em>th triangular number: that is, defined by the recursion T<sub>1</sub>=0, T<sub>n+1</sub>=T<sub>n</sub>+n.<br />
<br />Then any non-negative integer t, there are unique integers j and k with t=T<sub>j+1</sub>-k with 0&le;k&lt;j.</p>
<p>
<em>To see how, notice that there is a unique j such that t lies in the interval (T<sub>j</sub> , &#8230; , T<sub>j+1</sub>]=(T<sub>j+1</sub>-j , &#8230; , T<sub>j+1</sub>-0] and that this interval has width j so there is an appropriate choice of k. </em>
</p></blockquote>
<p>We then suppose that t satisfies [t]g=h. Then we have [T<sub>j+1</sub>]g=h&oplus;[k]g. So, instead of testing each [t] in turn until we hit equality, for a given j we need only test the &#8216;giant step&#8217; [T<sub>j+1</sub>]g against the set of &#8216;baby steps&#8217; &beta;={&beta;<sub>i</sub>}={h&oplus;[0]g,&#8230;,h&oplus;[i]g,&#8230;,h&oplus;[j-1]g. If that j yields no matches, we move to j&#8217;=j+1: by keeping track of [j]g at each iteration, the new T<sub>j&#8217;+1</sub> and the extra h&oplus;[j'-1]g are found by a single group operation each. Hence this is attractive from both storage and time complexity perspectives: we need only record the baby steps &beta;, [j]g and a single giant step at any given iteration j, whilst the time complexity is of order t<sup>1/2</sup>.</p>
<blockquote><p><strong>Terr&#8217;s BSGS variant for the DLP</strong><br /><em>Finds t such that [t]g=h for g generating G of unknown order, h from G.</em><br />
<br />Initialise &beta;={&beta;<sub>0</sub>=h}, &gamma;=&delta;=id<sub>G</sub>, j=0. (<em>(For each iteration, we have &gamma;=[T<sub>j+1</sub>]g and &delta;=[j]g</em>)<br />
Then loop over j as follows:</p>
<ul>
<li>Increment j by 1, then update:
</li>
<li>Set &delta;=&delta;&oplus;g=[j-1]g&oplus;g=[j]g.</li>
<li>Set &gamma;=&gamma;&oplus;&delta;=[T<sub>j</sub>]g+[j]g=[T<sub>j+1</sub>]g.</li>
<li>If j&ge;2 then
<ul>
<li>For s from 0 to j, if &gamma;=&beta;<sub>s</sub> then return T<sub>j+1</sub>-s</li>
</ul>
</li>
<li>Add &beta;<sub>j</sub>=&beta;<sub>j-1</sub>&oplus;g to &beta;</li>
</ul>
</blockquote>
<p>I&#8217;ve implemented this generic DLP algorithm and an order-finding version (which requires you to catch g=id<sub>G</sub>) as Maple procedures for arbitrary groups- details on that will be in the next post! BSGS-based approaches become impractical at finite field sizes well within the grasp of SEA for counting on elliptic curves; but are of interest in the higher genus case which lacks an Elkies procedure.</p>
]]></content:encoded>
			<wfw:commentRss>http://maths.straylight.co.uk/archives/73/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

