aboutsummaryrefslogtreecommitdiff
path: root/src/include/taler_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/taler_util.h')
-rw-r--r--src/include/taler_util.h47
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 */
246struct 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 */
258struct 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 */
246struct TALER_RefreshLinkEncrypted 270struct TALER_RefreshLinkEncrypted
@@ -295,9 +319,24 @@ struct TALER_RefreshLinkDecrypted
295 * @return #GNUNET_OK on success 319 * @return #GNUNET_OK on success
296 */ 320 */
297int 321int
298TALER_transfer_decrypt (const struct GNUNET_HashCode *secret_enc, 322TALER_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 */
336int
337TALER_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 */
310struct TALER_RefreshLinkDecrypted * 349struct TALER_RefreshLinkDecrypted *
311TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input, 350TALER_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 */
322struct TALER_RefreshLinkEncrypted * 361struct TALER_RefreshLinkEncrypted *
323TALER_refresh_encrypt (const struct TALER_RefreshLinkDecrypted *input, 362TALER_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