commit 43e728800f6048f4a6ee8c0178cfd895e8bce390
parent d5eab1233f12a705a3bd3aabffd562764b8eef7b
Author: Cedric <cedric.zwahlen@students.bfh.ch>
Date: Wed, 22 Nov 2023 23:45:58 +0100
Montgomery accepts odd numbers
Still rather untested, though
Diffstat:
5 files changed, 487 insertions(+), 134 deletions(-)
diff --git a/source/lib-gpu-verify.c b/source/lib-gpu-verify.c
@@ -10,7 +10,21 @@
int main(int argc, char** argv)
{
- mont_prepare("07", "0A", "0D");
+ mpz_t res;
+ mpz_init(res);
+
+ //mont_go(res,"13", "0F", "C7");
+
+ mont_go(res, "0177", "F9", "0184");
+
+ // mont_go(res, "13", "0F", "31");
+
+
+ char str[256];
+ mpz_get_str(str, 10, res); // result is base 10!
+
+ printf("%s\n",str);
+
//opencl_tests();
diff --git a/source/montgomery.c b/source/montgomery.c
@@ -9,6 +9,11 @@
// assume 64 bit, keep in mind that on the GPU, we can't dynamically allocate
+void mont_prepare(mpz_t b, mpz_t e, mpz_t m,
+ mpz_t r, mpz_t r_1,
+ mpz_t ni, mpz_t M, mpz_t x
+ );
+
void mont_product(mpz_t ret,
const mpz_t a, const mpz_t b,
const mpz_t r, const mpz_t r_1,
@@ -22,8 +27,15 @@ void mont_modexp(mpz_t ret,
const mpz_t r, const mpz_t r_1
);
-// CPU
-void mont_prepare(char *base, char *exponent, char *modulus) {
+void mont_finish(mpz_t ret,
+ const mpz_t xx,
+ const mpz_t n, const mpz_t ni,
+ const mpz_t r, const mpz_t r_1
+ );
+
+void mont_prepare_even_modulus(mpz_t m, mpz_t q, mpz_t powj);
+
+void mont_go(mpz_t res, char *base, char *exponent, char *modulus) {
mpz_t b,e,m;
@@ -32,41 +44,121 @@ void mont_prepare(char *base, char *exponent, char *modulus) {
mpz_init_set_str(m,modulus,16); // n
mpz_t r, r_1, ni, M, x;
- mpz_init(r);
+ mpz_init(r); // MARK: I think I have to destroy these myself
mpz_init(r_1);
mpz_init(ni);
mpz_init(M);
mpz_init(x);
+ mpz_t xx;
+ mpz_init(xx);
+
+ if (mpz_even_p(m)) {
+
+ mpz_t bb, x1, x2, q, powj;
+ mpz_init(bb);
+ mpz_init(x1);
+ mpz_init(x2);
+ mpz_init(q);
+ mpz_init(powj);
+
+ mont_prepare_even_modulus(m, q, powj);
+
+ // q is uneven, so we can use regular modexp
+ // MARK: we can improve the efficiency here by doing simple reductions
+
+ mpz_mod(bb, b, q);
+
+ mont_prepare(bb, e, q, r, r_1, ni, M, x);
+ mont_modexp(xx, x, e, M, q, ni, r, r_1);
+ mont_finish(x1, xx, q, ni, r, r_1);
+
+
+ // MARK: we can also reduce and really speed this up as well
+ mpz_powm(x2, b, e, powj);
+
+ mpz_t y, q_1;
+ mpz_init(y);
+ mpz_init(q_1);
+
+ mpz_sub(y, x2, x1);
+
+ mpz_invert(q_1, q, powj);
+
+ mpz_mul(y, y, q_1);
+ mpz_mod(y, y, powj);
+
+ mpz_addmul(x1, q, y);
+
+ mpz_set(res, x1);
+
+ printf("--\n");
+
+
+
+ } else {
+
+ mont_prepare(b, e, m, r, r_1, ni, M, x);
+
+ mont_modexp(xx, x, e, M, m, ni, r, r_1);
+
+ mont_finish(res, xx, m, ni, r, r_1);
+
+
+ }
+}
+
+
+void mont_prepare_even_modulus(mpz_t m, mpz_t q, mpz_t powj) {
+
+ mpz_t two; // powj == 2^j
+
+ mpz_init_set_ui(two, 2);
+
+ mp_bitcnt_t j = mpz_scan1(m, 0);
+
+ mpz_tdiv_q_2exp(q,m,j);
+ mpz_mul_2exp(powj,two,j - 1);
+
+ mpz_clear(two);
+
+}
+
+// CPU
+void mont_prepare(mpz_t b, mpz_t e, mpz_t m,
+ mpz_t r, mpz_t r_1,
+ mpz_t ni, mpz_t M, mpz_t x) {
+
+ // MARK: break this up, reduce the amount of temporary variables
// r and n (modulus) must be relatively prime (this is a given if n (modulus) is odd)
// calculate r, which must be larger than the modulo and also a power of 2
- size_t len = mpz_sizeinbase(m,2);
- mpz_init_set_si(r, 1 << len);
+ size_t len = mpz_sizeinbase(m,2) + 1;
+ mpz_init_set_si(r, 1 << len); // MARK: in fact, r should be 2^64 for 2048 bit ?
mpz_t one, o, oo; // some helper variables
- mpz_init(one); // must equal 1
+ mpz_init_set_si(one,0);
mpz_init_set_si(o,1);
mpz_init_set_si(oo,0);
- mpz_t temp_r_1, temp_ni; // more helper variables
- mpz_init(temp_r_1);
- mpz_init(temp_ni);
+ mpz_gcdext(one, r_1, ni, r, m); // set r_1 and ni
+
+ int sgn = mpz_sgn(r_1);
- mpz_gcdext(one, temp_r_1, temp_ni, r, m); // set r_1 and ni
+ mpz_abs(r_1, r_1);
+ mpz_abs(ni, ni);
- mpz_abs(temp_r_1, temp_r_1);
- mpz_abs(temp_ni, temp_ni);
+ if (sgn == -1) {
+ mpz_sub(ni, r, ni);
+ mpz_sub(r_1, m, r_1);
+ }
- mpz_sub(ni, r, temp_ni);
- mpz_sub(r_1, m, temp_r_1);
- // test if one == 1
if (mpz_cmp(o, one))
- assert(1);
+ assert(0);
mpz_mul(one, r, r_1);
mpz_mul(o,ni,m);
@@ -76,22 +168,16 @@ void mont_prepare(char *base, char *exponent, char *modulus) {
mpz_init_set_si(one, 1);
if (mpz_cmp(oo, one))
- assert(1);
+ assert(0);
mpz_mul(M, b, r);
mpz_mod(M, M, m); // set M
mpz_mod(x, r, m); // set x
- mpz_t res;
-
- mpz_init(res);
-
- //mont_product(res, x, x, r, r_1, m, ni);
-
- mont_modexp(res, x, e, M, m, ni, r, r_1);
-
-
+ mpz_clear(one);
+ mpz_clear(oo);
+ mpz_clear(o);
}
@@ -112,17 +198,27 @@ void mont_modexp(mpz_t ret,
int k = (int)mpz_sizeinbase(e,2);
for (int i = k - 1; i >= 0; i--) {
- printf("%d",i);
mont_product(xx, xx, xx, r, r_1, n, ni);
if (mpz_tstbit(e, i))
mont_product(xx, aa, xx, r, r_1, n, ni);
-
}
+
+ mpz_set(ret, xx);
+
+ mpz_clear(aa);
+ mpz_clear(xx);
+
+}
+
+void mont_finish(mpz_t ret,
+ const mpz_t xx,
+ const mpz_t n, const mpz_t ni,
+ const mpz_t r, const mpz_t r_1
+ ) {
- // this transforms out of the montgomery form, so maybe move that to finish
mpz_t x,one;
@@ -133,11 +229,8 @@ void mont_modexp(mpz_t ret,
mpz_set(ret, x);
-}
-
-void mont_finish(void) {
-
-
+ mpz_clear(x);
+ mpz_clear(one);
}
@@ -174,11 +267,18 @@ void mont_product(mpz_t ret,
mpz_add(ab, ab, mn);
- // this as well
- mpz_divexact(u, ab, r);
+ unsigned long sz = mpz_sizeinbase(r,2) - 1;
+ mpz_tdiv_q_2exp(u, ab, sz); // this is essentially a bit shift, instead of a division
if (mpz_cmp(u, n) >= 0)
mpz_sub(u, u, n);
mpz_set(ret, u);
+
+ mpz_clear(ab);
+ mpz_clear(mn);
+ mpz_clear(t);
+ mpz_clear(m);
+ mpz_clear(u);
+
}
diff --git a/source/montgomery.h b/source/montgomery.h
@@ -14,6 +14,11 @@
#include <assert.h>
-void mont_prepare(char *base, char *exponent, char *modulus);
-
+void mont_go(mpz_t res, char *base, char *exponent, char *modulus);
+/*
+void mont_prepare(mpz_t b, mpz_t e, mpz_t m,
+ mpz_t r, mpz_t r_1,
+ mpz_t ni, mpz_t M, mpz_t x
+ );
+*/
#endif /* montgomery_h */
diff --git a/xcode/lib-gpu-verify.xcodeproj/project.xcworkspace/xcuserdata/cedriczwahlen.xcuserdatad/UserInterfaceState.xcuserstate b/xcode/lib-gpu-verify.xcodeproj/project.xcworkspace/xcuserdata/cedriczwahlen.xcuserdatad/UserInterfaceState.xcuserstate
Binary files differ.
diff --git a/xcode/lib-gpu-verify.xcodeproj/xcuserdata/cedriczwahlen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/xcode/lib-gpu-verify.xcodeproj/xcuserdata/cedriczwahlen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
@@ -1193,15 +1193,15 @@
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "985780EE-603E-4B6C-BF80-1BB11F65F6BA"
- shouldBeEnabled = "Yes"
+ shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "96"
- endingLineNumber = "96"
- landmarkName = "mont_prepare(base, exponent, modulus)"
+ startingLineNumber = "182"
+ endingLineNumber = "182"
+ landmarkName = "mont_prepare(b, e, m, r, r_1, ni, M, x)"
landmarkType = "9">
<Locations>
<Location
@@ -1279,26 +1279,8 @@
endingLineNumber = "94"
offsetFromSymbolStart = "677">
</Location>
- </Locations>
- </BreakpointContent>
- </BreakpointProxy>
- <BreakpointProxy
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
- <BreakpointContent
- uuid = "714B2C00-5AA0-419D-8983-A6D8DF8F77EE"
- shouldBeEnabled = "No"
- ignoreCount = "0"
- continueAfterRunningActions = "No"
- filePath = "../source/montgomery.c"
- startingColumnNumber = "9223372036854775807"
- endingColumnNumber = "9223372036854775807"
- startingLineNumber = "49"
- endingLineNumber = "49"
- landmarkName = "mont_prepare(base, exponent, modulus)"
- landmarkType = "9">
- <Locations>
<Location
- uuid = "714B2C00-5AA0-419D-8983-A6D8DF8F77EE - 4382d64135f421be"
+ uuid = "985780EE-603E-4B6C-BF80-1BB11F65F6BA - 4382d64135f5d884"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
@@ -1308,12 +1290,12 @@
urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "39"
- endingLineNumber = "39"
- offsetFromSymbolStart = "201">
+ startingLineNumber = "93"
+ endingLineNumber = "93"
+ offsetFromSymbolStart = "677">
</Location>
<Location
- uuid = "714B2C00-5AA0-419D-8983-A6D8DF8F77EE - 4382d64135f421be"
+ uuid = "985780EE-603E-4B6C-BF80-1BB11F65F6BA - 4382d64135f5d8c6"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
@@ -1323,9 +1305,24 @@
urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "39"
- endingLineNumber = "39"
- offsetFromSymbolStart = "206">
+ startingLineNumber = "95"
+ endingLineNumber = "95"
+ offsetFromSymbolStart = "677">
+ </Location>
+ <Location
+ uuid = "985780EE-603E-4B6C-BF80-1BB11F65F6BA - 4382d64135f5d87a"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_prepare"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "99"
+ endingLineNumber = "99"
+ offsetFromSymbolStart = "722">
</Location>
</Locations>
</BreakpointContent>
@@ -2192,47 +2189,47 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
- uuid = "97D703B2-D63F-4EC4-A612-0E2231CC441C"
+ uuid = "DB8454C8-42E4-4F53-A753-783E113BA61B"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "74"
- endingLineNumber = "74"
- landmarkName = "mont_prepare(base, exponent, modulus)"
+ startingLineNumber = "276"
+ endingLineNumber = "276"
+ landmarkName = "mont_product(ret, a, b, r, r_1, n, ni)"
landmarkType = "9">
<Locations>
<Location
- uuid = "97D703B2-D63F-4EC4-A612-0E2231CC441C - 4382d64135f42485"
+ uuid = "DB8454C8-42E4-4F53-A753-783E113BA61B - 4382d80c0bf89e2c"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
- symbolName = "mont_prepare"
+ symbolName = "mont_product"
moduleName = "lib-gpu-verify"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "62"
- endingLineNumber = "62"
- offsetFromSymbolStart = "448">
+ startingLineNumber = "135"
+ endingLineNumber = "135"
+ offsetFromSymbolStart = "288">
</Location>
<Location
- uuid = "97D703B2-D63F-4EC4-A612-0E2231CC441C - 4382d64135f424a6"
+ uuid = "DB8454C8-42E4-4F53-A753-783E113BA61B - 4382d80c0bf897b3"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
- symbolName = "mont_prepare"
+ symbolName = "mont_product"
moduleName = "lib-gpu-verify"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "63"
- endingLineNumber = "63"
- offsetFromSymbolStart = "460">
+ startingLineNumber = "186"
+ endingLineNumber = "186"
+ offsetFromSymbolStart = "288">
</Location>
</Locations>
</BreakpointContent>
@@ -2240,47 +2237,77 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
- uuid = "3FBF3C5D-8FAE-42D2-AF5F-6D59CDF9A7D5"
+ uuid = "5237754D-0F3B-47A1-B768-D4F7FD47830D"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "68"
- endingLineNumber = "68"
- landmarkName = "mont_prepare(base, exponent, modulus)"
+ startingLineNumber = "207"
+ endingLineNumber = "207"
+ landmarkName = "mont_modexp(ret, a, e, M, n, ni, r, r_1)"
landmarkType = "9">
<Locations>
<Location
- uuid = "3FBF3C5D-8FAE-42D2-AF5F-6D59CDF9A7D5 - 4382d64135f427e0"
+ uuid = "5237754D-0F3B-47A1-B768-D4F7FD47830D - 554a9b6fb8ae9009"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
- symbolName = "mont_prepare"
+ symbolName = "mont_modexp"
moduleName = "lib-gpu-verify"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "57"
- endingLineNumber = "57"
- offsetFromSymbolStart = "382">
+ startingLineNumber = "125"
+ endingLineNumber = "125"
+ offsetFromSymbolStart = "231">
</Location>
<Location
- uuid = "3FBF3C5D-8FAE-42D2-AF5F-6D59CDF9A7D5 - 4382d64135f427e0"
+ uuid = "5237754D-0F3B-47A1-B768-D4F7FD47830D - 554a9b6fb8ae9009"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
- symbolName = "mont_prepare"
+ symbolName = "mont_modexp"
moduleName = "lib-gpu-verify"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "57"
- endingLineNumber = "57"
- offsetFromSymbolStart = "387">
+ startingLineNumber = "125"
+ endingLineNumber = "125"
+ offsetFromSymbolStart = "250">
+ </Location>
+ <Location
+ uuid = "5237754D-0F3B-47A1-B768-D4F7FD47830D - 554a9b6fb8ae938d"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_modexp"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "121"
+ endingLineNumber = "121"
+ offsetFromSymbolStart = "250">
+ </Location>
+ <Location
+ uuid = "5237754D-0F3B-47A1-B768-D4F7FD47830D - 554a9b6fb8ae9360"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_modexp"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "118"
+ endingLineNumber = "118"
+ offsetFromSymbolStart = "230">
</Location>
</Locations>
</BreakpointContent>
@@ -2288,47 +2315,110 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
- uuid = "DB8454C8-42E4-4F53-A753-783E113BA61B"
+ uuid = "2EF66FC4-83FF-48DC-BD74-7DCAF53542F8"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ filePath = "../source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "95"
+ endingLineNumber = "95"
+ landmarkName = "mont_go(res, base, exponent, modulus)"
+ landmarkType = "9">
+ <Locations>
+ <Location
+ uuid = "2EF66FC4-83FF-48DC-BD74-7DCAF53542F8 - 509351695818d924"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_go"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "95"
+ endingLineNumber = "95"
+ offsetFromSymbolStart = "642">
+ </Location>
+ <Location
+ uuid = "2EF66FC4-83FF-48DC-BD74-7DCAF53542F8 - 509351695818d947"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_go"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "94"
+ endingLineNumber = "94"
+ offsetFromSymbolStart = "642">
+ </Location>
+ <Location
+ uuid = "2EF66FC4-83FF-48DC-BD74-7DCAF53542F8 - 509351695818d924"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_go"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "95"
+ endingLineNumber = "95"
+ offsetFromSymbolStart = "660">
+ </Location>
+ </Locations>
+ </BreakpointContent>
+ </BreakpointProxy>
+ <BreakpointProxy
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+ <BreakpointContent
+ uuid = "C6EEB3B9-DBCA-4C09-9043-EEC04F29FE5E"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "183"
- endingLineNumber = "183"
- landmarkName = "mont_product(ret, a, b, r, r_1, n, ni)"
+ startingLineNumber = "80"
+ endingLineNumber = "80"
+ landmarkName = "mont_go(res, base, exponent, modulus)"
landmarkType = "9">
<Locations>
<Location
- uuid = "DB8454C8-42E4-4F53-A753-783E113BA61B - 4382d80c0bf89e2c"
+ uuid = "C6EEB3B9-DBCA-4C09-9043-EEC04F29FE5E - 5093516958192491"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
- symbolName = "mont_product"
+ symbolName = "mont_go"
moduleName = "lib-gpu-verify"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "135"
- endingLineNumber = "135"
- offsetFromSymbolStart = "288">
+ startingLineNumber = "76"
+ endingLineNumber = "76"
+ offsetFromSymbolStart = "449">
</Location>
<Location
- uuid = "DB8454C8-42E4-4F53-A753-783E113BA61B - 4382d80c0bf897b3"
+ uuid = "C6EEB3B9-DBCA-4C09-9043-EEC04F29FE5E - 5093516958192491"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
- symbolName = "mont_product"
+ symbolName = "mont_go"
moduleName = "lib-gpu-verify"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "186"
- endingLineNumber = "186"
- offsetFromSymbolStart = "288">
+ startingLineNumber = "76"
+ endingLineNumber = "76"
+ offsetFromSymbolStart = "446">
</Location>
</Locations>
</BreakpointContent>
@@ -2336,62 +2426,206 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
- uuid = "5237754D-0F3B-47A1-B768-D4F7FD47830D"
+ uuid = "B5C8842D-43A1-48AF-B843-DA7C249FABDD"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "123"
- endingLineNumber = "123"
- landmarkName = "mont_modexp(ret, a, e, M, n, ni, r, r_1)"
+ startingLineNumber = "86"
+ endingLineNumber = "86"
+ landmarkName = "mont_go(res, base, exponent, modulus)"
landmarkType = "9">
<Locations>
<Location
- uuid = "5237754D-0F3B-47A1-B768-D4F7FD47830D - 554a9b6fb8ae9009"
+ uuid = "B5C8842D-43A1-48AF-B843-DA7C249FABDD - 509351695818da4f"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
- symbolName = "mont_modexp"
+ symbolName = "mont_go"
moduleName = "lib-gpu-verify"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "125"
- endingLineNumber = "125"
- offsetFromSymbolStart = "231">
+ startingLineNumber = "86"
+ endingLineNumber = "86"
+ offsetFromSymbolStart = "519">
</Location>
<Location
- uuid = "5237754D-0F3B-47A1-B768-D4F7FD47830D - 554a9b6fb8ae9009"
+ uuid = "B5C8842D-43A1-48AF-B843-DA7C249FABDD - 509351695818da6e"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
- symbolName = "mont_modexp"
+ symbolName = "mont_go"
moduleName = "lib-gpu-verify"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "125"
- endingLineNumber = "125"
- offsetFromSymbolStart = "250">
+ startingLineNumber = "85"
+ endingLineNumber = "85"
+ offsetFromSymbolStart = "519">
</Location>
<Location
- uuid = "5237754D-0F3B-47A1-B768-D4F7FD47830D - 554a9b6fb8ae938d"
+ uuid = "B5C8842D-43A1-48AF-B843-DA7C249FABDD - 509351695818da4f"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
- symbolName = "mont_modexp"
+ symbolName = "mont_go"
moduleName = "lib-gpu-verify"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "121"
- endingLineNumber = "121"
- offsetFromSymbolStart = "250">
+ startingLineNumber = "86"
+ endingLineNumber = "86"
+ offsetFromSymbolStart = "537">
+ </Location>
+ </Locations>
+ </BreakpointContent>
+ </BreakpointProxy>
+ <BreakpointProxy
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+ <BreakpointContent
+ uuid = "5B4EE098-39B2-40C9-B573-DEFE8DCB7F4E"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ filePath = "../source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "72"
+ endingLineNumber = "72"
+ landmarkName = "mont_go(res, base, exponent, modulus)"
+ landmarkType = "9">
+ <Locations>
+ <Location
+ uuid = "5B4EE098-39B2-40C9-B573-DEFE8DCB7F4E - 509351695819243c"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_go"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "71"
+ endingLineNumber = "71"
+ offsetFromSymbolStart = "297">
+ </Location>
+ <Location
+ uuid = "5B4EE098-39B2-40C9-B573-DEFE8DCB7F4E - 509351695819241d"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_go"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "72"
+ endingLineNumber = "72"
+ offsetFromSymbolStart = "312">
+ </Location>
+ </Locations>
+ </BreakpointContent>
+ </BreakpointProxy>
+ <BreakpointProxy
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+ <BreakpointContent
+ uuid = "66C954E0-FB86-4D51-9DC9-17349FF75295"
+ shouldBeEnabled = "No"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ filePath = "../source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "160"
+ endingLineNumber = "160"
+ landmarkName = "mont_prepare(b, e, m, r, r_1, ni, M, x)"
+ landmarkType = "9">
+ <Locations>
+ <Location
+ uuid = "66C954E0-FB86-4D51-9DC9-17349FF75295 - 4382d64135f5d361"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_prepare"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "154"
+ endingLineNumber = "154"
+ offsetFromSymbolStart = "229">
+ </Location>
+ <Location
+ uuid = "66C954E0-FB86-4D51-9DC9-17349FF75295 - 4382d64135f5d361"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_prepare"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "154"
+ endingLineNumber = "154"
+ offsetFromSymbolStart = "203">
+ </Location>
+ </Locations>
+ </BreakpointContent>
+ </BreakpointProxy>
+ <BreakpointProxy
+ BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+ <BreakpointContent
+ uuid = "239A39EA-25E5-40A3-A9FC-BA8B2F93B3AF"
+ shouldBeEnabled = "No"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ filePath = "../source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "150"
+ endingLineNumber = "150"
+ landmarkName = "mont_prepare(b, e, m, r, r_1, ni, M, x)"
+ landmarkType = "9">
+ <Locations>
+ <Location
+ uuid = "239A39EA-25E5-40A3-A9FC-BA8B2F93B3AF - 4382d64135f5d30e"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_prepare"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "151"
+ endingLineNumber = "151"
+ offsetFromSymbolStart = "195">
+ </Location>
+ <Location
+ uuid = "239A39EA-25E5-40A3-A9FC-BA8B2F93B3AF - 4382d64135f5d3ed"
+ shouldBeEnabled = "Yes"
+ ignoreCount = "0"
+ continueAfterRunningActions = "No"
+ symbolName = "mont_prepare"
+ moduleName = "lib-gpu-verify"
+ usesParentBreakpointCondition = "Yes"
+ urlString = "file:///Users/cedriczwahlen/libgpuverify/source/montgomery.c"
+ startingColumnNumber = "9223372036854775807"
+ endingColumnNumber = "9223372036854775807"
+ startingLineNumber = "150"
+ endingLineNumber = "150"
+ offsetFromSymbolStart = "169">
</Location>
</Locations>
</BreakpointContent>
@@ -2399,16 +2633,16 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
- uuid = "611D5F4B-F0CE-4BB5-B380-7D1B42A74A10"
+ uuid = "A248494D-2839-48D5-B2FA-0923BE649C1F"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../source/montgomery.c"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "92"
- endingLineNumber = "92"
- landmarkName = "mont_prepare(base, exponent, modulus)"
+ startingLineNumber = "170"
+ endingLineNumber = "170"
+ landmarkName = "mont_prepare(b, e, m, r, r_1, ni, M, x)"
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>