diff options
Diffstat (limited to 'src/include/taler_util.h')
-rw-r--r-- | src/include/taler_util.h | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/src/include/taler_util.h b/src/include/taler_util.h index db6f22e68..19e6bacf1 100644 --- a/src/include/taler_util.h +++ b/src/include/taler_util.h | |||
@@ -241,6 +241,30 @@ TALER_data_to_string_alloc (const void *buf, | |||
241 | /* ****************** Refresh crypto primitives ************* */ | 241 | /* ****************** Refresh crypto primitives ************* */ |
242 | 242 | ||
243 | /** | 243 | /** |
244 | * Secret used to decrypt refresh links. | ||
245 | */ | ||
246 | struct TALER_LinkSecret | ||
247 | { | ||
248 | /** | ||
249 | * Secret used to decrypt the refresh link data. | ||
250 | */ | ||
251 | char key[sizeof (struct GNUNET_HashCode)]; | ||
252 | }; | ||
253 | |||
254 | |||
255 | /** | ||
256 | * Encrypted secret used to decrypt refresh links. | ||
257 | */ | ||
258 | struct TALER_EncryptedLinkSecret | ||
259 | { | ||
260 | /** | ||
261 | * Encrypted secret, must be the given size! | ||
262 | */ | ||
263 | char enc[sizeof (struct TALER_LinkSecret)]; | ||
264 | }; | ||
265 | |||
266 | |||
267 | /** | ||
244 | * Representation of an encrypted refresh link. | 268 | * Representation of an encrypted refresh link. |
245 | */ | 269 | */ |
246 | struct TALER_RefreshLinkEncrypted | 270 | struct TALER_RefreshLinkEncrypted |
@@ -295,9 +319,24 @@ struct TALER_RefreshLinkDecrypted | |||
295 | * @return #GNUNET_OK on success | 319 | * @return #GNUNET_OK on success |
296 | */ | 320 | */ |
297 | int | 321 | int |
298 | TALER_transfer_decrypt (const struct GNUNET_HashCode *secret_enc, | 322 | TALER_transfer_decrypt (const struct TALER_EncryptedLinkSecret *secret_enc, |
323 | const struct GNUNET_HashCode *trans_sec, | ||
324 | struct TALER_LinkSecret *secret); | ||
325 | |||
326 | |||
327 | /** | ||
328 | * Use the @a trans_sec (from ECDHE) to encrypt the @a secret | ||
329 | * to obtain the @a secret_enc. | ||
330 | * | ||
331 | * @param secret shared secret for refresh link decryption | ||
332 | * @param trans_sec transfer secret (FIXME: use different type?) | ||
333 | * @param secret_enc[out] encrypted secret | ||
334 | * @return #GNUNET_OK on success | ||
335 | */ | ||
336 | int | ||
337 | TALER_transfer_encrypt (const struct TALER_LinkSecret *secret, | ||
299 | const struct GNUNET_HashCode *trans_sec, | 338 | const struct GNUNET_HashCode *trans_sec, |
300 | struct GNUNET_HashCode *secret); | 339 | struct TALER_EncryptedLinkSecret *secret_enc); |
301 | 340 | ||
302 | 341 | ||
303 | /** | 342 | /** |
@@ -309,7 +348,7 @@ TALER_transfer_decrypt (const struct GNUNET_HashCode *secret_enc, | |||
309 | */ | 348 | */ |
310 | struct TALER_RefreshLinkDecrypted * | 349 | struct TALER_RefreshLinkDecrypted * |
311 | TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input, | 350 | TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input, |
312 | const struct GNUNET_HashCode *secret); | 351 | const struct TALER_LinkSecret *secret); |
313 | 352 | ||
314 | 353 | ||
315 | /** | 354 | /** |
@@ -321,7 +360,7 @@ TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input, | |||
321 | */ | 360 | */ |
322 | struct TALER_RefreshLinkEncrypted * | 361 | struct TALER_RefreshLinkEncrypted * |
323 | TALER_refresh_encrypt (const struct TALER_RefreshLinkDecrypted *input, | 362 | TALER_refresh_encrypt (const struct TALER_RefreshLinkDecrypted *input, |
324 | const struct GNUNET_HashCode *secret); | 363 | const struct TALER_LinkSecret *secret); |
325 | 364 | ||
326 | 365 | ||
327 | #endif | 366 | #endif |