From 7c9a329af74fda3acab0db93e0787674ffc3bd11 Mon Sep 17 00:00:00 2001
From: Nik <njunger@uwaterloo.ca>
Date: Wed, 4 Feb 2015 14:29:49 -0500
Subject: [PATCH] Minor documentation fixes

---
 doc.go           |  4 ++--
 element.go       | 10 ++++++----
 element_arith.go |  4 ++--
 element_io.go    |  7 ++++---
 pairing.go       |  3 ++-
 5 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/doc.go b/doc.go
index 9929051..c2c0041 100644
--- a/doc.go
+++ b/doc.go
@@ -66,7 +66,7 @@
 	implemented in the library. Each type has different time and space
 	requirements. For more information about the types, see the documentation
 	for the corresponding generator calls, or the PBC manual page at
-	https://crypto.stanford.edu/pbc/manual/ch08s03.html.
+	https://crypto.stanford.edu/pbc/manual/ch05s01.html.
 
 	Dependencies
 
@@ -105,7 +105,7 @@
 
 		./configure
 		make
-		make install
+		sudo make install
 
 	After installing, you may need to rebuild the search path for libraries:
 
diff --git a/element.go b/element.go
index 7c51b51..077706d 100644
--- a/element.go
+++ b/element.go
@@ -70,10 +70,12 @@ import "runtime"
 // both 0 and 1 represent the identity element). It is recommended that
 // programs choose one convention and stick with it to avoid confusion.
 //
+// In contrast, the GT group is currently implemented as a subgroup of a finite
+// field, so only multiplicative operations should be used for GT.
+//
 // Not all operations are valid for all elements. For example, pairing
-// operations require an element from G1, and element from G2, and a target
-// from GT. As another example, elements in a ring cannot be inverted in
-// general.
+// operations require an element from G1, an element from G2, and a target from
+// GT. As another example, elements in a ring cannot be inverted in general.
 //
 // The PBC library does not attempt to detect invalid element operations. If an
 // invalid operation is performed, several outcomes are possible. In the best
@@ -93,7 +95,7 @@ import "runtime"
 // whether or not the target element is checked. Thus, if an unchecked element
 // is passed a checked element as part of an operation, the operation will not
 // be checked. Checked elements expect that all arguments to their methods are
-// also checked, and will panic with ErrUncheckedOp if not.
+// also checked, and will panic with ErrUncheckedOp if they are not.
 //
 // Note that not all possible errors can be detected by checked elements;
 // ultimately, it is the responsibility of the caller to ensure that the
diff --git a/element_arith.go b/element_arith.go
index 4a233ba..b38df52 100644
--- a/element_arith.go
+++ b/element_arith.go
@@ -82,7 +82,7 @@ func (el *Element) IsSquare() bool {
 }
 
 // Sign returns 0 if el is 0. If el is not 0, the behavior depends on the
-// algebraic structure, but has the property that el.Sign() == !neg.Sign()
+// algebraic structure, but has the property that el.Sign() == -neg.Sign()
 // where neg is the negation of el.
 func (el *Element) Sign() int {
 	sign := int64(C.element_sign(el.cptr))
@@ -322,7 +322,7 @@ func (el *Element) Pow3Big(x *Element, i *big.Int, y *Element, j *big.Int, z *El
 	return el
 }
 
-// Pow3Big sets el = x^i * y^j * z^k and returns el. This is generally faster
+// Pow3Zn sets el = x^i * y^j * z^k and returns el. This is generally faster
 // than performing separate exponentiations.
 //
 // Requirements:
diff --git a/element_io.go b/element_io.go
index 62169f6..fd451a5 100644
--- a/element_io.go
+++ b/element_io.go
@@ -35,9 +35,10 @@ import (
 )
 
 // BigInt converts the Element to a big.Int if such an operation makes sense.
-// Note that elements in GT cannot be converted using this method, even though
-// this is possible in the original PBC library. If callers wish to convert the
-// first coordinate into an integer, they should explicitly call X().
+// Note that elliptic curve points cannot be converted using this method, even
+// though this is possible in the original PBC library. If callers wish to
+// convert the first coordinate into an integer, they should explicitly call
+// X().
 //
 // Requirements:
 // el is expressible as an integer (e.g., an element of Zn, but not a point).
diff --git a/pairing.go b/pairing.go
index 0516c69..b7d60bd 100644
--- a/pairing.go
+++ b/pairing.go
@@ -36,7 +36,8 @@ import (
 
 // Field denotes the various possible algebraic structures associated with a
 // pairing. G1, G2, and GT are the groups involved in the pairing operation. Zr
-// is the field of integers with order r, where r is the order of the groups.
+// is the field of integers with order r, where r is the order of G1, G2, and
+// GT.
 type Field int
 
 const (
-- 
GitLab