summaryrefslogtreecommitdiff
path: root/src/util/crypto.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-05-16 14:15:34 +0200
committerChristian Grothoff <christian@grothoff.org>2015-05-16 14:15:34 +0200
commitf4a59d1cccd058b3180ea23ed9fdea69cb2129b8 (patch)
treead732a3b92fcd74f5c1295ceee5c06e3a63b3206 /src/util/crypto.c
parentd080e59e272e307b9ebc267f2c4dd2941cd79436 (diff)
downloadexchange-f4a59d1cccd058b3180ea23ed9fdea69cb2129b8.tar.gz
exchange-f4a59d1cccd058b3180ea23ed9fdea69cb2129b8.tar.bz2
exchange-f4a59d1cccd058b3180ea23ed9fdea69cb2129b8.zip
eliminating ECDSA, replacing with EdDSA-ECDHE-combo in transfer protocol
Diffstat (limited to 'src/util/crypto.c')
-rw-r--r--src/util/crypto.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/util/crypto.c b/src/util/crypto.c
index 529caa930..966f010e4 100644
--- a/src/util/crypto.c
+++ b/src/util/crypto.c
@@ -214,7 +214,7 @@ TALER_refresh_decrypt (const struct TALER_RefreshLinkEncrypted *input,
ret = GNUNET_new (struct TALER_RefreshLinkDecrypted);
memcpy (&ret->coin_priv,
buf,
- sizeof (union TALER_CoinSpendPrivateKeyP));
+ sizeof (struct TALER_CoinSpendPrivateKeyP));
ret->blinding_key.rsa_blinding_key
= GNUNET_CRYPTO_rsa_blinding_key_decode (&buf[sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey)],
input->blinding_key_enc_size);
@@ -290,7 +290,7 @@ TALER_refresh_link_encrypted_decode (const char *buf,
{
struct TALER_RefreshLinkEncrypted *rle;
- if (buf_len < sizeof (union TALER_CoinSpendPrivateKeyP))
+ if (buf_len < sizeof (struct TALER_CoinSpendPrivateKeyP))
return NULL;
if (buf_len >= GNUNET_MAX_MALLOC_CHECKED)
{
@@ -298,9 +298,9 @@ TALER_refresh_link_encrypted_decode (const char *buf,
return NULL;
}
rle = GNUNET_malloc (sizeof (struct TALER_RefreshLinkEncrypted) +
- buf_len - sizeof (union TALER_CoinSpendPrivateKeyP));
+ buf_len - sizeof (struct TALER_CoinSpendPrivateKeyP));
rle->blinding_key_enc = (const char *) &rle[1];
- rle->blinding_key_enc_size = buf_len - sizeof (union TALER_CoinSpendPrivateKeyP);
+ rle->blinding_key_enc_size = buf_len - sizeof (struct TALER_CoinSpendPrivateKeyP);
memcpy (rle->coin_priv_enc,
buf,
buf_len);
@@ -321,12 +321,12 @@ TALER_refresh_link_encrypted_encode (const struct TALER_RefreshLinkEncrypted *rl
{
char *buf;
- if (rle->blinding_key_enc_size >= GNUNET_MAX_MALLOC_CHECKED - sizeof (union TALER_CoinSpendPrivateKeyP))
+ if (rle->blinding_key_enc_size >= GNUNET_MAX_MALLOC_CHECKED - sizeof (struct TALER_CoinSpendPrivateKeyP))
{
GNUNET_break (0);
return NULL;
}
- *buf_len = sizeof (union TALER_CoinSpendPrivateKeyP) + rle->blinding_key_enc_size;
+ *buf_len = sizeof (struct TALER_CoinSpendPrivateKeyP) + rle->blinding_key_enc_size;
buf = GNUNET_malloc (*buf_len);
memcpy (buf,
rle->coin_priv_enc,
@@ -379,15 +379,15 @@ TALER_test_coin_valid (const struct TALER_CoinPublicInfo *coin_public_info)
int
TALER_link_decrypt_secret (const struct TALER_EncryptedLinkSecretP *secret_enc,
const struct TALER_TransferPrivateKeyP *trans_priv,
- const union TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_LinkSecretP *secret)
{
struct TALER_TransferSecretP transfer_secret;
if (GNUNET_OK !=
- GNUNET_CRYPTO_ecc_ecdh (&trans_priv->ecdhe_priv,
- &coin_pub->ecdhe_pub,
- &transfer_secret.key))
+ GNUNET_CRYPTO_ecdh_eddsa (&trans_priv->ecdhe_priv,
+ &coin_pub->eddsa_pub,
+ &transfer_secret.key))
{
GNUNET_break (0);
return GNUNET_SYSERR;
@@ -418,15 +418,15 @@ TALER_link_decrypt_secret (const struct TALER_EncryptedLinkSecretP *secret_enc,
int
TALER_link_decrypt_secret2 (const struct TALER_EncryptedLinkSecretP *secret_enc,
const struct TALER_TransferPublicKeyP *trans_pub,
- const union TALER_CoinSpendPrivateKeyP *coin_priv,
+ const struct TALER_CoinSpendPrivateKeyP *coin_priv,
struct TALER_LinkSecretP *secret)
{
struct TALER_TransferSecretP transfer_secret;
if (GNUNET_OK !=
- GNUNET_CRYPTO_ecc_ecdh (&coin_priv->ecdhe_priv,
- &trans_pub->ecdhe_pub,
- &transfer_secret.key))
+ GNUNET_CRYPTO_eddsa_ecdh (&coin_priv->eddsa_priv,
+ &trans_pub->ecdhe_pub,
+ &transfer_secret.key))
{
GNUNET_break (0);
return GNUNET_SYSERR;
@@ -456,7 +456,7 @@ TALER_link_decrypt_secret2 (const struct TALER_EncryptedLinkSecretP *secret_enc,
*/
int
TALER_link_encrypt_secret (const struct TALER_LinkSecretP *secret,
- const union TALER_CoinSpendPublicKeyP *coin_pub,
+ const struct TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_TransferPrivateKeyP *trans_priv,
struct TALER_TransferPublicKeyP *trans_pub,
struct TALER_EncryptedLinkSecretP *secret_enc)
@@ -466,9 +466,9 @@ TALER_link_encrypt_secret (const struct TALER_LinkSecretP *secret,
pk = GNUNET_CRYPTO_ecdhe_key_create ();
if (GNUNET_OK !=
- GNUNET_CRYPTO_ecc_ecdh (pk,
- &coin_pub->ecdhe_pub,
- &transfer_secret.key))
+ GNUNET_CRYPTO_ecdh_eddsa (pk,
+ &coin_pub->eddsa_pub,
+ &transfer_secret.key))
{
GNUNET_break (0);
GNUNET_free (pk);