diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-02-03 12:59:42 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-02-03 12:59:42 +0000 |
commit | ae54c0647ef8f7d3064c2135dc71f0afcc887150 (patch) | |
tree | f4cdc8bdda394a261b876d1a88133a9e3086f974 /src/include/gnunet_crypto_lib.h | |
parent | 795ee680b5750325ac3b070c67ad6838904df873 (diff) | |
download | gnunet-ae54c0647ef8f7d3064c2135dc71f0afcc887150.tar.gz gnunet-ae54c0647ef8f7d3064c2135dc71f0afcc887150.zip |
-export ecc generation function
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r-- | src/include/gnunet_crypto_lib.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 90f9d4e45..6120b48d8 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -1264,6 +1264,15 @@ GNUNET_CRYPTO_ecc_key_create_from_file (const char *filename); | |||
1264 | */ | 1264 | */ |
1265 | struct GNUNET_CRYPTO_EccKeyGenerationContext; | 1265 | struct GNUNET_CRYPTO_EccKeyGenerationContext; |
1266 | 1266 | ||
1267 | /** | ||
1268 | * Create a new private key. Caller must free return value. Blocking version | ||
1269 | * (blocks to gather entropy). | ||
1270 | * | ||
1271 | * @return fresh private key | ||
1272 | */ | ||
1273 | struct GNUNET_CRYPTO_EccPrivateKey * | ||
1274 | GNUNET_CRYPTO_ecc_key_create (void); | ||
1275 | |||
1267 | 1276 | ||
1268 | /** | 1277 | /** |
1269 | * Create a new private key by reading it from a file. If the files | 1278 | * Create a new private key by reading it from a file. If the files |
@@ -1303,6 +1312,20 @@ GNUNET_CRYPTO_ecc_setup_hostkey (const char *cfg_name); | |||
1303 | 1312 | ||
1304 | 1313 | ||
1305 | /** | 1314 | /** |
1315 | * Derive key material from a public and a private ECC key. | ||
1316 | * | ||
1317 | * @param key private key to use for the ECDH (x) | ||
1318 | * @param pub public key to use for the ECDY (yG) | ||
1319 | * @param key_material where to write the key material (xyG) | ||
1320 | * @return GNUNET_SYSERR on error, GNUNET_OK on success | ||
1321 | */ | ||
1322 | int | ||
1323 | GNUNET_CRYPTO_ecc_ecdh (const struct GNUNET_CRYPTO_EccPrivateKey *key, | ||
1324 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *pub, | ||
1325 | struct GNUNET_HashCode *key_material); | ||
1326 | |||
1327 | |||
1328 | /** | ||
1306 | * Sign a given block. | 1329 | * Sign a given block. |
1307 | * | 1330 | * |
1308 | * @param key private key to use for the signing | 1331 | * @param key private key to use for the signing |