Merge pull request #31 from apache/issue29-update-amcl

Update AMCL and apply trick to MTA ZKP
diff --git a/src/mta.c b/src/mta.c
index 54afbbc..d41174e 100644
--- a/src/mta.c
+++ b/src/mta.c
@@ -336,8 +336,8 @@
 
     // Curve order
     OCT_fromHex(&OCT, curve_order_hex);
-    FF_2048_zero(q, HFLEN_2048);
-    BIG_512_60_fromBytesLen(q[0],OCT.val,OCT.len);
+    OCT_pad(&OCT, HFS_2048);
+    FF_2048_fromOctet(q, &OCT, HFLEN_2048);
 
     FF_2048_mul(n, key->p, key->q, HFLEN_2048);
     FF_2048_copy(g, n, FFLEN_2048);
@@ -694,8 +694,8 @@
 
     // Curve order
     OCT_fromHex(&OCT, curve_order_hex);
-    FF_2048_zero(q, HFLEN_2048);
-    BIG_512_60_fromBytesLen(q[0],OCT.val,OCT.len);
+    OCT_pad(&OCT, HFS_2048);
+    FF_2048_fromOctet(q, &OCT, HFLEN_2048);
 
     // Zero out beta since it's needed regardless of RNG
     FF_4096_zero(beta, FFLEN_4096);
@@ -1075,8 +1075,8 @@
 
     // Reduce alpha modulo curve order
     OCT_fromHex(&OCT, curve_order_hex);
-    FF_2048_zero(ff_q, HFLEN_2048);
-    BIG_1024_58_fromBytesLen(ff_q[0], OCT.val, OCT.len);
+    OCT_pad(&OCT, HFS_2048);
+    FF_2048_fromOctet(ff_q, &OCT, HFLEN_2048);
 
     FF_2048_copy(ff_alpha, rv->alpha, HFLEN_2048);
     FF_2048_mod(ff_alpha, ff_q, HFLEN_2048);
@@ -1174,8 +1174,8 @@
 
     // Reduce s1 modulo curve order
     OCT_fromHex(&OCT, curve_order_hex);
-    FF_2048_zero(ff_q, HFLEN_2048);
-    BIG_1024_58_fromBytesLen(ff_q[0], OCT.val, OCT.len);
+    OCT_pad(&OCT, HFS_2048);
+    FF_2048_fromOctet(ff_q, &OCT, HFLEN_2048);
 
     FF_2048_copy(ff_s1, p->s1, HFLEN_2048);
     FF_2048_mod(ff_s1, ff_q, HFLEN_2048);