diff options
Diffstat (limited to 'src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c')
-rw-r--r-- | src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c index 4b17bafee..0e1f3ba6a 100644 --- a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c +++ b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c | |||
@@ -40,11 +40,20 @@ | |||
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Maximum allowed result value for the scalarproduct computation. | 42 | * Maximum allowed result value for the scalarproduct computation. |
43 | * DLOG will fail if the result is bigger. | 43 | * DLOG will fail if the result is bigger. At 1 million, the |
44 | * precomputation takes about 2s on a fast machine. | ||
44 | */ | 45 | */ |
45 | #define MAX_RESULT (1024 * 1024) | 46 | #define MAX_RESULT (1024 * 1024) |
46 | 47 | ||
47 | /** | 48 | /** |
49 | * How many values should DLOG store in memory (determines baseline | ||
50 | * RAM consumption, roughly 100 bytes times the value given here). | ||
51 | * Should be about SQRT (MAX_RESULT), larger values will make the | ||
52 | * online computation faster. | ||
53 | */ | ||
54 | #define MAX_RAM (1024) | ||
55 | |||
56 | /** | ||
48 | * An encrypted element key-value pair. | 57 | * An encrypted element key-value pair. |
49 | */ | 58 | */ |
50 | struct MpiElement | 59 | struct MpiElement |
@@ -1162,8 +1171,8 @@ run (void *cls, | |||
1162 | }; | 1171 | }; |
1163 | 1172 | ||
1164 | cfg = c; | 1173 | cfg = c; |
1165 | edc = GNUNET_CRYPTO_ecc_dlog_prepare (MAX_RESULT /* max value */, | 1174 | edc = GNUNET_CRYPTO_ecc_dlog_prepare (MAX_RESULT, |
1166 | 1024 /* RAM */); | 1175 | MAX_RAM); |
1167 | /* Select a random 'a' value for Alice */ | 1176 | /* Select a random 'a' value for Alice */ |
1168 | GNUNET_CRYPTO_ecc_rnd_mpi (edc, | 1177 | GNUNET_CRYPTO_ecc_rnd_mpi (edc, |
1169 | &my_privkey, | 1178 | &my_privkey, |