aboutsummaryrefslogtreecommitdiff
path: root/test_crypto.c
diff options
context:
space:
mode:
authorMarkus Teich <markus.teich@stusta.mhn.de>2016-06-20 00:36:18 +0200
committerMarkus Teich <markus.teich@stusta.mhn.de>2016-06-20 00:36:18 +0200
commit65775f8276b082a18c99cb75c11193685bd5d822 (patch)
tree626229703ecafef6ce509584582f2e3b181f5bab /test_crypto.c
parent8e44164facc215a09984d83f488345f548753477 (diff)
downloadlibbrandt-65775f8276b082a18c99cb75c11193685bd5d822.tar.gz
libbrandt-65775f8276b082a18c99cb75c11193685bd5d822.zip
add 3dim array helpers
Diffstat (limited to 'test_crypto.c')
-rw-r--r--test_crypto.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test_crypto.c b/test_crypto.c
index 6d4a029..a9acdde 100644
--- a/test_crypto.c
+++ b/test_crypto.c
@@ -47,6 +47,27 @@ test_smc_2d_array ()
47 47
48 48
49int 49int
50test_smc_3d_array ()
51{
52 gcry_mpi_point_t ***array;
53 uint16_t size1 = 3;
54 uint16_t size2 = 7;
55 uint16_t size3 = 11;
56 uint16_t i, j, k;
57
58 array = smc_init3 (size1, size2, size3);
59 check (array, "memory allocation failed");
60
61 for (i = 0; i < size1; i++)
62 for (j = 0; j < size2; j++)
63 for (k = 0; k < size3; k++)
64 check (array[i][j][k], "point has not been initialized");
65
66 smc_free3 (array, size1, size2, size3);
67}
68
69
70int
50test_smc_zkp_dl () 71test_smc_zkp_dl ()
51{ 72{
52 gcry_mpi_t c = gcry_mpi_new (0); 73 gcry_mpi_t c = gcry_mpi_new (0);
@@ -185,6 +206,7 @@ main (int argc, char *argv[])
185 206
186 /* tests that need to run only once */ 207 /* tests that need to run only once */
187 run (test_smc_2d_array); 208 run (test_smc_2d_array);
209 run (test_smc_3d_array);
188 210
189 for (tests_run = 0; tests_run < repeat; tests_run++) 211 for (tests_run = 0; tests_run < repeat; tests_run++)
190 { 212 {