summaryrefslogtreecommitdiff
path: root/appl/lib/ida/mktab.b
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 17:07:39 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 17:07:39 +0000
commit37da2899f40661e3e9631e497da8dc59b971cbd0 (patch)
treecbc6d4680e347d906f5fa7fca73214418741df72 /appl/lib/ida/mktab.b
parent54bc8ff236ac10b3eaa928fd6bcfc0cdb2ba46ae (diff)
20060303a
Diffstat (limited to 'appl/lib/ida/mktab.b')
-rw-r--r--appl/lib/ida/mktab.b32
1 files changed, 32 insertions, 0 deletions
diff --git a/appl/lib/ida/mktab.b b/appl/lib/ida/mktab.b
new file mode 100644
index 00000000..96025d3f
--- /dev/null
+++ b/appl/lib/ida/mktab.b
@@ -0,0 +1,32 @@
+implement Genfield;
+
+include "sys.m";
+ sys: Sys;
+
+include "draw.m";
+
+include "keyring.m";
+ kr: Keyring;
+ IPint: import kr;
+
+Genfield: module
+{
+ init: fn(nil: ref Draw->Context, nil: list of string);
+};
+
+Field: con 65537;
+
+init(nil: ref Draw->Context, args: list of string)
+{
+ sys = load Sys Sys->PATH;
+ kr = load Keyring Keyring->PATH;
+
+ f := IPint.inttoip(Field);
+ fm2 := f.sub(IPint.inttoip(2));
+ for(i := 1; i <= Field; i++){
+ x := IPint.inttoip(i);
+ y := x.expmod(fm2, f);
+# sys->print("%s\n", x.mul(y).expmod(IPint.inttoip(1), f).iptostr(10));
+ sys->print("%d,\n", y.iptoint());
+ }
+}