File: patch-wrt-ntl-5.4.2

package info (click to toggle)
gf2x 1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 2,612 kB
  • ctags: 725
  • sloc: sh: 11,112; ansic: 7,549; cpp: 1,369; makefile: 490; perl: 151
file content (57 lines) | stat: -rw-r--r-- 1,395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--- a/src/Wizard	2008-03-05 00:35:01.000000000 +0100
+++ b/src/Wizard	2008-10-12 16:05:39.000000000 +0200
@@ -81,6 +81,7 @@
 cp ../include/NTL/WordVector.h small/include/NTL
 cp ../include/NTL/vec_GF2.h small/include/NTL
 cp ../include/NTL/GF2X.h small/include/NTL
+ln -s ../../../include/@@gf2x_inject@@ small/include/
 
 cp cfile small/src
 cp WizardAux small/src
--- a/src/GF2X.c	2008-03-05 00:35:01.000000000 +0100
+++ b/src/GF2X.c	2008-10-12 17:14:03.000000000 +0200
@@ -451,7 +451,23 @@
 }
 
 
+#if 1
+#include "@@gf2x_inject@@/gf2x.h"
 
+void mul(GF2X& c, const GF2X& a, const GF2X& b)
+{
+   long sa = a.xrep.length();
+   long sb = b.xrep.length();
+
+   if (sa <= 0 || sb <= 0) {
+      clear(c);
+      return;
+   }
+   c.xrep.SetLength(sa+sb);
+   gf2x_mul(c.xrep.elts(), a.xrep.elts(), sa, b.xrep.elts(), sb);
+   c.normalize();
+}
+#else
 
 
 /*
@@ -1264,6 +1280,9 @@
 
 
 
+#endif
+
+
 
 void mul(GF2X& c, const GF2X& a, long b)
 {
--- a/src/makefile	2008-03-05 00:35:02.000000000 +0100
+++ b/src/makefile	2008-10-12 19:21:00.000000000 +0200
@@ -488,7 +488,7 @@
 
 
 GF2XTimeTest:
-	$(LINK_CXX) -o GF2XTimeTest GF2XTimeTest.c wntl.a  $(GMP_LIBDIR) $(GMP_LIB) $(LDLIBS_CXX)
+	$(LINK_CXX) -o GF2XTimeTest GF2XTimeTest.c wntl.a ../include/@@gf2x_inject@@/libgf2x.la $(GMP_LIBDIR) $(GMP_LIB) $(LDLIBS_CXX)
 
 InitSettings:
 	$(LINK_CXX) -o InitSettings InitSettings.c  $(LDLIBS_CXX)