aboutsummaryrefslogtreecommitdiff
path: root/ecdsa_model_fpga.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ecdsa_model_fpga.cpp')
-rw-r--r--ecdsa_model_fpga.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/ecdsa_model_fpga.cpp b/ecdsa_model_fpga.cpp
index 8ad0962..546e206 100644
--- a/ecdsa_model_fpga.cpp
+++ b/ecdsa_model_fpga.cpp
@@ -112,6 +112,39 @@ int main()
//
+ // test base point multiplier: H = 2 * G
+ //
+ FPGA_BUFFER two;
+ fpga_modular_add(&ecdsa_one, &ecdsa_one, &two);
+
+ printf("Trying to double the base point...\n\n");
+ ok = test_base_point_multiplier(&two, &ecdsa_h_x, &ecdsa_h_y);
+ if (!ok) return EXIT_FAILURE;
+
+
+ //
+ // test base point multiplier: G = (n + 1) * G
+ //
+ FPGA_BUFFER n1;
+ fpga_modular_add(&ecdsa_n, &ecdsa_one, &n1); // n1 = n + 1
+
+ printf("Trying to multiply the base point by its order plus one...\n\n");
+ ok = test_base_point_multiplier(&n1, &ecdsa_g_x, &ecdsa_g_y);
+ if (!ok) return EXIT_FAILURE;
+
+
+ //
+ // test base point multiplier: G = (n + 2) * G
+ //
+ FPGA_BUFFER n2;
+ fpga_modular_add(&ecdsa_n, &two, &n2); // n2 = n + two
+
+ printf("Trying to multiply the base point by its order plus two...\n\n");
+ ok = test_base_point_multiplier(&n2, &ecdsa_h_x, &ecdsa_h_y);
+ if (!ok) return EXIT_FAILURE;
+
+
+ //
// try to abuse internal point doubler
//
ok = abuse_internal_point_doubler();