projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add cyclic group abstraction, with test code. Separate off exponentation
[u/mdw/catacomb]
/
ec-gentab.sh
diff --git
a/ec-gentab.sh
b/ec-gentab.sh
index
ea63094
..
40fd853
100755
(executable)
--- a/
ec-gentab.sh
+++ b/
ec-gentab.sh
@@
-11,6
+11,7
@@
cat <<EOF
#include "ectab.h"
#define N(x) (sizeof(x)/sizeof(*x))
#include "ectab.h"
#define N(x) (sizeof(x)/sizeof(*x))
+#define MP(x) { x, x + N(x), N(x), 0, MP_CONST, 0 }
/*----- Curve data --------------------------------------------------------*/
/*----- Curve data --------------------------------------------------------*/
@@
-43,19
+44,19
@@
EOF
if [ $t != b ]; then echo >&2 "$0: wanted b; found $t"; exit 1; fi
cat <<EOF
if [ $t != b ]; then echo >&2 "$0: wanted b; found $t"; exit 1; fi
cat <<EOF
-static
const
mpw c_${n}_p[] = {
+static mpw c_${n}_p[] = {
EOF
./mpdump $p
cat <<EOF
};
EOF
./mpdump $p
cat <<EOF
};
-static
const
mpw c_${n}_a[] = {
+static mpw c_${n}_a[] = {
EOF
./mpdump $a
cat <<EOF
};
EOF
./mpdump $a
cat <<EOF
};
-static
const
mpw c_${n}_b[] = {
+static mpw c_${n}_b[] = {
EOF
./mpdump $b
cat <<EOF
EOF
./mpdump $b
cat <<EOF
@@
-76,25
+77,25
@@
EOF
if [ $t != gy ]; then echo >&2 "$0: wanted gy; found $t"; exit 1; fi
cat <<EOF
if [ $t != gy ]; then echo >&2 "$0: wanted gy; found $t"; exit 1; fi
cat <<EOF
-static
const
mpw c_${n}_r[] = {
+static mpw c_${n}_r[] = {
EOF
./mpdump $r
cat <<EOF
};
EOF
./mpdump $r
cat <<EOF
};
-static
const
mpw c_${n}_h[] = {
+static mpw c_${n}_h[] = {
EOF
./mpdump $h
cat <<EOF
};
EOF
./mpdump $h
cat <<EOF
};
-static
const
mpw c_${n}_gx[] = {
+static mpw c_${n}_gx[] = {
EOF
./mpdump $gx
cat <<EOF
};
EOF
./mpdump $gx
cat <<EOF
};
-static
const
mpw c_${n}_gy[] = {
+static mpw c_${n}_gy[] = {
EOF
./mpdump $gy
cat <<EOF
EOF
./mpdump $gy
cat <<EOF
@@
-108,15
+109,15
@@
EOF
binpoly) ftag=FTAG_BINPOLY;;
esac
cat <<EOF
binpoly) ftag=FTAG_BINPOLY;;
esac
cat <<EOF
-static
const
ecdata c_$n = {
+static ecdata c_$n = {
$ftag,
$ftag,
-
c_${n}_p, N
(c_${n}_p),
-
c_${n}_a, N
(c_${n}_a),
-
c_${n}_b, N
(c_${n}_b),
-
c_${n}_r, N
(c_${n}_r),
-
c_${n}_h, N
(c_${n}_h),
-
c_${n}_gx, N
(c_${n}_gx),
-
c_${n}_gy, N
(c_${n}_gy)
+
MP
(c_${n}_p),
+
MP
(c_${n}_a),
+
MP
(c_${n}_b),
+
MP
(c_${n}_r),
+
MP
(c_${n}_h),
+
MP
(c_${n}_gx),
+
MP
(c_${n}_gy)
};
EOF
};
EOF