summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/resources
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2017-03-18 10:41:29 +0100
committerDavid Ostrovsky <david@ostrovsky.org>2017-03-18 16:46:58 +0100
commit7e4258113cf899ec707e7214dabc91914c5feb63 (patch)
treea3e5acd1f5eb4c11edbf8b4d8d22d262e1795b27 /org.eclipse.jgit/resources
parent50ac852551b43d77c2a20dcd9816cf4d4404cdee (diff)
downloadjgit-7e4258113cf899ec707e7214dabc91914c5feb63.tar.gz
jgit-7e4258113cf899ec707e7214dabc91914c5feb63.zip
Move SHA1 compress/recompress files to resource folder
This fixes Bazel build: in srcs attribute of java_library rule //org.eclipse.jgit:jgit: file '//org.eclipse.jgit:src/org/eclipse/jgit/util/sha1/SHA1.recompress' is misplaced here (expected .java, .srcjar or .properties). Another option that was considered is to exclude the non source files. Change-Id: I7083f27a4a49bf6681c85c7cf7b08a83c9a70c77 Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Diffstat (limited to 'org.eclipse.jgit/resources')
-rw-r--r--org.eclipse.jgit/resources/org/eclipse/jgit/util/sha1/SHA1.compress92
-rw-r--r--org.eclipse.jgit/resources/org/eclipse/jgit/util/sha1/SHA1.recompress192
2 files changed, 284 insertions, 0 deletions
diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/util/sha1/SHA1.compress b/org.eclipse.jgit/resources/org/eclipse/jgit/util/sha1/SHA1.compress
new file mode 100644
index 0000000000..3a80fd2aaf
--- /dev/null
+++ b/org.eclipse.jgit/resources/org/eclipse/jgit/util/sha1/SHA1.compress
@@ -0,0 +1,92 @@
+/* Template for compress method; run through cpp. */
+
+#define ROUND1_STEP(a, b, c, d, e, T) e += s1(a,b,c,d,w[T]); b = rotateLeft(b, 30)
+#define ROUND2_STEP(a, b, c, d, e, T) e += s2(a,b,c,d,w[T]); b = rotateLeft(b, 30)
+#define ROUND3_STEP(a, b, c, d, e, T) e += s3(a,b,c,d,w[T]); b = rotateLeft(b, 30)
+#define ROUND4_STEP(a, b, c, d, e, T) e += s4(a,b,c,d,w[T]); b = rotateLeft(b, 30)
+
+ ROUND1_STEP(a, b, c, d, e, 0);
+ ROUND1_STEP(e, a, b, c, d, 1);
+ ROUND1_STEP(d, e, a, b, c, 2);
+ ROUND1_STEP(c, d, e, a, b, 3);
+ ROUND1_STEP(b, c, d, e, a, 4);
+ ROUND1_STEP(a, b, c, d, e, 5);
+ ROUND1_STEP(e, a, b, c, d, 6);
+ ROUND1_STEP(d, e, a, b, c, 7);
+ ROUND1_STEP(c, d, e, a, b, 8);
+ ROUND1_STEP(b, c, d, e, a, 9);
+ ROUND1_STEP(a, b, c, d, e, 10);
+ ROUND1_STEP(e, a, b, c, d, 11);
+ ROUND1_STEP(d, e, a, b, c, 12);
+ ROUND1_STEP(c, d, e, a, b, 13);
+ ROUND1_STEP(b, c, d, e, a, 14);
+ ROUND1_STEP(a, b, c, d, e, 15);
+ ROUND1_STEP(e, a, b, c, d, 16);
+ ROUND1_STEP(d, e, a, b, c, 17);
+ ROUND1_STEP(c, d, e, a, b, 18);
+ ROUND1_STEP(b, c, d, e, a, 19);
+
+ ROUND2_STEP(a, b, c, d, e, 20);
+ ROUND2_STEP(e, a, b, c, d, 21);
+ ROUND2_STEP(d, e, a, b, c, 22);
+ ROUND2_STEP(c, d, e, a, b, 23);
+ ROUND2_STEP(b, c, d, e, a, 24);
+ ROUND2_STEP(a, b, c, d, e, 25);
+ ROUND2_STEP(e, a, b, c, d, 26);
+ ROUND2_STEP(d, e, a, b, c, 27);
+ ROUND2_STEP(c, d, e, a, b, 28);
+ ROUND2_STEP(b, c, d, e, a, 29);
+ ROUND2_STEP(a, b, c, d, e, 30);
+ ROUND2_STEP(e, a, b, c, d, 31);
+ ROUND2_STEP(d, e, a, b, c, 32);
+ ROUND2_STEP(c, d, e, a, b, 33);
+ ROUND2_STEP(b, c, d, e, a, 34);
+ ROUND2_STEP(a, b, c, d, e, 35);
+ ROUND2_STEP(e, a, b, c, d, 36);
+ ROUND2_STEP(d, e, a, b, c, 37);
+ ROUND2_STEP(c, d, e, a, b, 38);
+ ROUND2_STEP(b, c, d, e, a, 39);
+
+ ROUND3_STEP(a, b, c, d, e, 40);
+ ROUND3_STEP(e, a, b, c, d, 41);
+ ROUND3_STEP(d, e, a, b, c, 42);
+ ROUND3_STEP(c, d, e, a, b, 43);
+ ROUND3_STEP(b, c, d, e, a, 44);
+ ROUND3_STEP(a, b, c, d, e, 45);
+ ROUND3_STEP(e, a, b, c, d, 46);
+ ROUND3_STEP(d, e, a, b, c, 47);
+ ROUND3_STEP(c, d, e, a, b, 48);
+ ROUND3_STEP(b, c, d, e, a, 49);
+ ROUND3_STEP(a, b, c, d, e, 50);
+ ROUND3_STEP(e, a, b, c, d, 51);
+ ROUND3_STEP(d, e, a, b, c, 52);
+ ROUND3_STEP(c, d, e, a, b, 53);
+ ROUND3_STEP(b, c, d, e, a, 54);
+ ROUND3_STEP(a, b, c, d, e, 55);
+ ROUND3_STEP(e, a, b, c, d, 56);
+ ROUND3_STEP(d, e, a, b, c, 57);
+ state58.save(a, b, c, d, e);
+ ROUND3_STEP(c, d, e, a, b, 58);
+ ROUND3_STEP(b, c, d, e, a, 59);
+
+ ROUND4_STEP(a, b, c, d, e, 60);
+ ROUND4_STEP(e, a, b, c, d, 61);
+ ROUND4_STEP(d, e, a, b, c, 62);
+ ROUND4_STEP(c, d, e, a, b, 63);
+ ROUND4_STEP(b, c, d, e, a, 64);
+ state65.save(a, b, c, d, e);
+ ROUND4_STEP(a, b, c, d, e, 65);
+ ROUND4_STEP(e, a, b, c, d, 66);
+ ROUND4_STEP(d, e, a, b, c, 67);
+ ROUND4_STEP(c, d, e, a, b, 68);
+ ROUND4_STEP(b, c, d, e, a, 69);
+ ROUND4_STEP(a, b, c, d, e, 70);
+ ROUND4_STEP(e, a, b, c, d, 71);
+ ROUND4_STEP(d, e, a, b, c, 72);
+ ROUND4_STEP(c, d, e, a, b, 73);
+ ROUND4_STEP(b, c, d, e, a, 74);
+ ROUND4_STEP(a, b, c, d, e, 75);
+ ROUND4_STEP(e, a, b, c, d, 76);
+ ROUND4_STEP(d, e, a, b, c, 77);
+ ROUND4_STEP(c, d, e, a, b, 78);
+ ROUND4_STEP(b, c, d, e, a, 79);
diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/util/sha1/SHA1.recompress b/org.eclipse.jgit/resources/org/eclipse/jgit/util/sha1/SHA1.recompress
new file mode 100644
index 0000000000..44d3d6db84
--- /dev/null
+++ b/org.eclipse.jgit/resources/org/eclipse/jgit/util/sha1/SHA1.recompress
@@ -0,0 +1,192 @@
+/* Template for recompress method; run through cpp. */
+
+#define ROUND1_STEP(a, b, c, d, e, T) {e += s1(a,b,c,d,w2[T]); b = rotateLeft(b, 30);}
+#define ROUND2_STEP(a, b, c, d, e, T) {e += s2(a,b,c,d,w2[T]); b = rotateLeft(b, 30);}
+#define ROUND3_STEP(a, b, c, d, e, T) {e += s3(a,b,c,d,w2[T]); b = rotateLeft(b, 30);}
+#define ROUND4_STEP(a, b, c, d, e, T) {e += s4(a,b,c,d,w2[T]); b = rotateLeft(b, 30);}
+
+#define ROUND1_STEP_BW(a, b, c, d, e, T) {b = rotateRight(b, 30); e -= s1(a,b,c,d,w2[T]);}
+#define ROUND2_STEP_BW(a, b, c, d, e, T) {b = rotateRight(b, 30); e -= s2(a,b,c,d,w2[T]);}
+#define ROUND3_STEP_BW(a, b, c, d, e, T) {b = rotateRight(b, 30); e -= s3(a,b,c,d,w2[T]);}
+#define ROUND4_STEP_BW(a, b, c, d, e, T) {b = rotateRight(b, 30); e -= s4(a,b,c,d,w2[T]);}
+
+ /* Condition to go backwards: if (t > step) */
+ /* t=80-66 have no identified DV; skip.
+ ROUND4_STEP_BW(b, c, d, e, a, 79)
+ ROUND4_STEP_BW(c, d, e, a, b, 78)
+ ROUND4_STEP_BW(d, e, a, b, c, 77)
+ ROUND4_STEP_BW(e, a, b, c, d, 76)
+ ROUND4_STEP_BW(a, b, c, d, e, 75)
+ ROUND4_STEP_BW(b, c, d, e, a, 74)
+ ROUND4_STEP_BW(c, d, e, a, b, 73)
+ ROUND4_STEP_BW(d, e, a, b, c, 72)
+ ROUND4_STEP_BW(e, a, b, c, d, 71)
+ ROUND4_STEP_BW(a, b, c, d, e, 70)
+ ROUND4_STEP_BW(b, c, d, e, a, 69)
+ ROUND4_STEP_BW(c, d, e, a, b, 68)
+ ROUND4_STEP_BW(d, e, a, b, c, 67)
+ ROUND4_STEP_BW(e, a, b, c, d, 66)
+ ROUND4_STEP_BW(a, b, c, d, e, 65)
+ */
+ if (t == 65) {
+ ROUND4_STEP_BW(b, c, d, e, a, 64)
+ ROUND4_STEP_BW(c, d, e, a, b, 63)
+ ROUND4_STEP_BW(d, e, a, b, c, 62)
+ ROUND4_STEP_BW(e, a, b, c, d, 61)
+ ROUND4_STEP_BW(a, b, c, d, e, 60)
+
+ ROUND3_STEP_BW(b, c, d, e, a, 59)
+ ROUND3_STEP_BW(c, d, e, a, b, 58)
+ }
+ ROUND3_STEP_BW(d, e, a, b, c, 57)
+ ROUND3_STEP_BW(e, a, b, c, d, 56)
+ ROUND3_STEP_BW(a, b, c, d, e, 55)
+ ROUND3_STEP_BW(b, c, d, e, a, 54)
+ ROUND3_STEP_BW(c, d, e, a, b, 53)
+ ROUND3_STEP_BW(d, e, a, b, c, 52)
+ ROUND3_STEP_BW(e, a, b, c, d, 51)
+ ROUND3_STEP_BW(a, b, c, d, e, 50)
+ ROUND3_STEP_BW(b, c, d, e, a, 49)
+ ROUND3_STEP_BW(c, d, e, a, b, 48)
+ ROUND3_STEP_BW(d, e, a, b, c, 47)
+ ROUND3_STEP_BW(e, a, b, c, d, 46)
+ ROUND3_STEP_BW(a, b, c, d, e, 45)
+ ROUND3_STEP_BW(b, c, d, e, a, 44)
+ ROUND3_STEP_BW(c, d, e, a, b, 43)
+ ROUND3_STEP_BW(d, e, a, b, c, 42)
+ ROUND3_STEP_BW(e, a, b, c, d, 41)
+ ROUND3_STEP_BW(a, b, c, d, e, 40)
+
+ ROUND2_STEP_BW(b, c, d, e, a, 39)
+ ROUND2_STEP_BW(c, d, e, a, b, 38)
+ ROUND2_STEP_BW(d, e, a, b, c, 37)
+ ROUND2_STEP_BW(e, a, b, c, d, 36)
+ ROUND2_STEP_BW(a, b, c, d, e, 35)
+ ROUND2_STEP_BW(b, c, d, e, a, 34)
+ ROUND2_STEP_BW(c, d, e, a, b, 33)
+ ROUND2_STEP_BW(d, e, a, b, c, 32)
+ ROUND2_STEP_BW(e, a, b, c, d, 31)
+ ROUND2_STEP_BW(a, b, c, d, e, 30)
+ ROUND2_STEP_BW(b, c, d, e, a, 29)
+ ROUND2_STEP_BW(c, d, e, a, b, 28)
+ ROUND2_STEP_BW(d, e, a, b, c, 27)
+ ROUND2_STEP_BW(e, a, b, c, d, 26)
+ ROUND2_STEP_BW(a, b, c, d, e, 25)
+ ROUND2_STEP_BW(b, c, d, e, a, 24)
+ ROUND2_STEP_BW(c, d, e, a, b, 23)
+ ROUND2_STEP_BW(d, e, a, b, c, 22)
+ ROUND2_STEP_BW(e, a, b, c, d, 21)
+ ROUND2_STEP_BW(a, b, c, d, e, 20)
+
+ ROUND1_STEP_BW(b, c, d, e, a, 19)
+ ROUND1_STEP_BW(c, d, e, a, b, 18)
+ ROUND1_STEP_BW(d, e, a, b, c, 17)
+ ROUND1_STEP_BW(e, a, b, c, d, 16)
+ ROUND1_STEP_BW(a, b, c, d, e, 15)
+ ROUND1_STEP_BW(b, c, d, e, a, 14)
+ ROUND1_STEP_BW(c, d, e, a, b, 13)
+ ROUND1_STEP_BW(d, e, a, b, c, 12)
+ ROUND1_STEP_BW(e, a, b, c, d, 11)
+ ROUND1_STEP_BW(a, b, c, d, e, 10)
+ ROUND1_STEP_BW(b, c, d, e, a, 9)
+ ROUND1_STEP_BW(c, d, e, a, b, 8)
+ ROUND1_STEP_BW(d, e, a, b, c, 7)
+ ROUND1_STEP_BW(e, a, b, c, d, 6)
+ ROUND1_STEP_BW(a, b, c, d, e, 5)
+ ROUND1_STEP_BW(b, c, d, e, a, 4)
+ ROUND1_STEP_BW(c, d, e, a, b, 3)
+ ROUND1_STEP_BW(d, e, a, b, c, 2)
+ ROUND1_STEP_BW(e, a, b, c, d, 1)
+ ROUND1_STEP_BW(a, b, c, d, e, 0)
+
+ hIn.save(a, b, c, d, e);
+ a = s.a; b = s.b; c = s.c; d = s.d; e = s.e;
+
+ /* Condition to go fowards: if (t <= step) */
+ /* Earliest restart is T=58; skip.
+ ROUND1_STEP(a, b, c, d, e, 0)
+ ROUND1_STEP(e, a, b, c, d, 1)
+ ROUND1_STEP(d, e, a, b, c, 2)
+ ROUND1_STEP(c, d, e, a, b, 3)
+ ROUND1_STEP(b, c, d, e, a, 4)
+ ROUND1_STEP(a, b, c, d, e, 5)
+ ROUND1_STEP(e, a, b, c, d, 6)
+ ROUND1_STEP(d, e, a, b, c, 7)
+ ROUND1_STEP(c, d, e, a, b, 8)
+ ROUND1_STEP(b, c, d, e, a, 9)
+ ROUND1_STEP(a, b, c, d, e, 10)
+ ROUND1_STEP(e, a, b, c, d, 11)
+ ROUND1_STEP(d, e, a, b, c, 12)
+ ROUND1_STEP(c, d, e, a, b, 13)
+ ROUND1_STEP(b, c, d, e, a, 14)
+ ROUND1_STEP(a, b, c, d, e, 15)
+ ROUND1_STEP(e, a, b, c, d, 16)
+ ROUND1_STEP(d, e, a, b, c, 17)
+ ROUND1_STEP(c, d, e, a, b, 18)
+ ROUND1_STEP(b, c, d, e, a, 19)
+
+ ROUND2_STEP(a, b, c, d, e, 20)
+ ROUND2_STEP(e, a, b, c, d, 21)
+ ROUND2_STEP(d, e, a, b, c, 22)
+ ROUND2_STEP(c, d, e, a, b, 23)
+ ROUND2_STEP(b, c, d, e, a, 24)
+ ROUND2_STEP(a, b, c, d, e, 25)
+ ROUND2_STEP(e, a, b, c, d, 26)
+ ROUND2_STEP(d, e, a, b, c, 27)
+ ROUND2_STEP(c, d, e, a, b, 28)
+ ROUND2_STEP(b, c, d, e, a, 29)
+ ROUND2_STEP(a, b, c, d, e, 30)
+ ROUND2_STEP(e, a, b, c, d, 31)
+ ROUND2_STEP(d, e, a, b, c, 32)
+ ROUND2_STEP(c, d, e, a, b, 33)
+ ROUND2_STEP(b, c, d, e, a, 34)
+ ROUND2_STEP(a, b, c, d, e, 35)
+ ROUND2_STEP(e, a, b, c, d, 36)
+ ROUND2_STEP(d, e, a, b, c, 37)
+ ROUND2_STEP(c, d, e, a, b, 38)
+ ROUND2_STEP(b, c, d, e, a, 39)
+
+ ROUND3_STEP(a, b, c, d, e, 40)
+ ROUND3_STEP(e, a, b, c, d, 41)
+ ROUND3_STEP(d, e, a, b, c, 42)
+ ROUND3_STEP(c, d, e, a, b, 43)
+ ROUND3_STEP(b, c, d, e, a, 44)
+ ROUND3_STEP(a, b, c, d, e, 45)
+ ROUND3_STEP(e, a, b, c, d, 46)
+ ROUND3_STEP(d, e, a, b, c, 47)
+ ROUND3_STEP(c, d, e, a, b, 48)
+ ROUND3_STEP(b, c, d, e, a, 49)
+ ROUND3_STEP(a, b, c, d, e, 50)
+ ROUND3_STEP(e, a, b, c, d, 51)
+ ROUND3_STEP(d, e, a, b, c, 52)
+ ROUND3_STEP(c, d, e, a, b, 53)
+ ROUND3_STEP(b, c, d, e, a, 54)
+ ROUND3_STEP(a, b, c, d, e, 55)
+ ROUND3_STEP(e, a, b, c, d, 56)
+ ROUND3_STEP(d, e, a, b, c, 57)
+ */
+ if (t == 58) {
+ ROUND3_STEP(c, d, e, a, b, 58)
+ ROUND3_STEP(b, c, d, e, a, 59)
+
+ ROUND4_STEP(a, b, c, d, e, 60)
+ ROUND4_STEP(e, a, b, c, d, 61)
+ ROUND4_STEP(d, e, a, b, c, 62)
+ ROUND4_STEP(c, d, e, a, b, 63)
+ ROUND4_STEP(b, c, d, e, a, 64)
+ }
+ ROUND4_STEP(a, b, c, d, e, 65)
+ ROUND4_STEP(e, a, b, c, d, 66)
+ ROUND4_STEP(d, e, a, b, c, 67)
+ ROUND4_STEP(c, d, e, a, b, 68)
+ ROUND4_STEP(b, c, d, e, a, 69)
+ ROUND4_STEP(a, b, c, d, e, 70)
+ ROUND4_STEP(e, a, b, c, d, 71)
+ ROUND4_STEP(d, e, a, b, c, 72)
+ ROUND4_STEP(c, d, e, a, b, 73)
+ ROUND4_STEP(b, c, d, e, a, 74)
+ ROUND4_STEP(a, b, c, d, e, 75)
+ ROUND4_STEP(e, a, b, c, d, 76)
+ ROUND4_STEP(d, e, a, b, c, 77)
+ ROUND4_STEP(c, d, e, a, b, 78)
+ ROUND4_STEP(b, c, d, e, a, 79)