aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_crypto_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-10-17 21:16:37 +0000
committerChristian Grothoff <christian@grothoff.org>2012-10-17 21:16:37 +0000
commit1e97e9b8006fa195f14d02fbe0282afd1e4809ff (patch)
treead56de929806d0b5575894406573dd8b324fcaa1 /src/include/gnunet_crypto_lib.h
parent8c4f13e5109054a8f7ad3555b6db51c81eec5e0b (diff)
downloadgnunet-1e97e9b8006fa195f14d02fbe0282afd1e4809ff.tar.gz
gnunet-1e97e9b8006fa195f14d02fbe0282afd1e4809ff.zip
-ecc sign/verify only
Diffstat (limited to 'src/include/gnunet_crypto_lib.h')
-rw-r--r--src/include/gnunet_crypto_lib.h52
1 files changed, 1 insertions, 51 deletions
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h
index 59f1dad78..3bb60d9e5 100644
--- a/src/include/gnunet_crypto_lib.h
+++ b/src/include/gnunet_crypto_lib.h
@@ -270,7 +270,7 @@ struct GNUNET_CRYPTO_EccSignaturePurpose
270struct GNUNET_CRYPTO_EccSignature 270struct GNUNET_CRYPTO_EccSignature
271{ 271{
272 /** 272 /**
273 * Overall size of the encrypted data. 273 * Overall size of the signature data.
274 */ 274 */
275 uint16_t size; 275 uint16_t size;
276 276
@@ -319,23 +319,6 @@ struct GNUNET_CRYPTO_EccPrivateKeyBinaryEncoded
319 319
320 320
321/** 321/**
322 * ECC Encrypted data.
323 */
324struct GNUNET_CRYPTO_EccEncryptedData
325{
326 /**
327 * Overall size of the encrypted data.
328 */
329 uint16_t size;
330
331 /**
332 * S-expression, padded with zeros.
333 */
334 char encoding[GNUNET_CRYPTO_ECC_DATA_ENCODING_LENGTH];
335};
336
337
338/**
339 * @brief type for session keys 322 * @brief type for session keys
340 */ 323 */
341struct GNUNET_CRYPTO_AesSessionKey 324struct GNUNET_CRYPTO_AesSessionKey
@@ -1325,39 +1308,6 @@ GNUNET_CRYPTO_ecc_setup_hostkey (const char *cfg_name);
1325 1308
1326 1309
1327/** 1310/**
1328 * Encrypt a block with the public key of another host that uses the
1329 * same cipher.
1330 *
1331 * @param block the block to encrypt
1332 * @param size the size of block
1333 * @param publicKey the encoded public key used to encrypt
1334 * @param target where to store the encrypted block
1335 * @returns GNUNET_SYSERR on error, GNUNET_OK if ok
1336 */
1337int
1338GNUNET_CRYPTO_ecc_encrypt (const void *block, size_t size,
1339 const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded
1340 *publicKey,
1341 struct GNUNET_CRYPTO_EccEncryptedData *target);
1342
1343
1344/**
1345 * Decrypt a given block with the hostkey.
1346 *
1347 * @param key the key with which to decrypt this block
1348 * @param block the data to decrypt, encoded as returned by encrypt
1349 * @param result pointer to a location where the result can be stored
1350 * @param max the maximum number of bits to store for the result, if
1351 * the decrypted block is bigger, an error is returned
1352 * @return the size of the decrypted block, -1 on error
1353 */
1354ssize_t
1355GNUNET_CRYPTO_ecc_decrypt (const struct GNUNET_CRYPTO_EccPrivateKey *key,
1356 const struct GNUNET_CRYPTO_EccEncryptedData *block,
1357 void *result, size_t max);
1358
1359
1360/**
1361 * Sign a given block. 1311 * Sign a given block.
1362 * 1312 *
1363 * @param key private key to use for the signing 1313 * @param key private key to use for the signing