[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35407 - gnunet/src/include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35407 - gnunet/src/include |
Date: |
Thu, 19 Mar 2015 14:12:55 +0100 |
Author: grothoff
Date: 2015-03-19 14:12:55 +0100 (Thu, 19 Mar 2015)
New Revision: 35407
Modified:
gnunet/src/include/gnunet_crypto_lib.h
gnunet/src/include/gnunet_protocols.h
Log:
-get test to work, but with ecdsa instead of eddsa
Modified: gnunet/src/include/gnunet_crypto_lib.h
===================================================================
--- gnunet/src/include/gnunet_crypto_lib.h 2015-03-19 13:12:47 UTC (rev
35406)
+++ gnunet/src/include/gnunet_crypto_lib.h 2015-03-19 13:12:55 UTC (rev
35407)
@@ -405,7 +405,9 @@
* @return updated crc sum (must be subjected to #GNUNET_CRYPTO_crc16_finish
to get actual crc16)
*/
uint32_t
-GNUNET_CRYPTO_crc16_step (uint32_t sum, const void *buf, size_t len);
+GNUNET_CRYPTO_crc16_step (uint32_t sum,
+ const void *buf,
+ size_t len);
/**
@@ -427,7 +429,8 @@
* @return crc16 value
*/
uint16_t
-GNUNET_CRYPTO_crc16_n (const void *buf, size_t len);
+GNUNET_CRYPTO_crc16_n (const void *buf,
+ size_t len);
/**
@@ -440,7 +443,8 @@
* @return the resulting CRC32 checksum
*/
int32_t
-GNUNET_CRYPTO_crc32_n (const void *buf, size_t len);
+GNUNET_CRYPTO_crc32_n (const void *buf,
+ size_t len);
/**
@@ -452,7 +456,9 @@
* @param length buffer length
*/
void
-GNUNET_CRYPTO_random_block (enum GNUNET_CRYPTO_Quality mode, void *buffer,
size_t length);
+GNUNET_CRYPTO_random_block (enum GNUNET_CRYPTO_Quality mode,
+ void *buffer,
+ size_t length);
/**
* @ingroup crypto
@@ -463,7 +469,8 @@
* @return a random value in the interval [0,@a i) (exclusive).
*/
uint32_t
-GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i);
+GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode,
+ uint32_t i);
/**
@@ -475,7 +482,8 @@
* @return random 64-bit number
*/
uint64_t
-GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max);
+GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode,
+ uint64_t max);
/**
@@ -488,7 +496,8 @@
* @return the permutation array (allocated from heap)
*/
unsigned int *
-GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n);
+GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode,
+ unsigned int n);
/**
@@ -513,7 +522,8 @@
* @return the size of the encrypted block, -1 for errors
*/
ssize_t
-GNUNET_CRYPTO_symmetric_encrypt (const void *block, size_t size,
+GNUNET_CRYPTO_symmetric_encrypt (const void *block,
+ size_t size,
const struct
GNUNET_CRYPTO_SymmetricSessionKey *sessionkey,
const struct
GNUNET_CRYPTO_SymmetricInitializationVector *iv,
void *result);
@@ -531,7 +541,8 @@
* @return -1 on failure, size of decrypted block on success
*/
ssize_t
-GNUNET_CRYPTO_symmetric_decrypt (const void *block, size_t size,
+GNUNET_CRYPTO_symmetric_decrypt (const void *block,
+ size_t size,
const struct
GNUNET_CRYPTO_SymmetricSessionKey *sessionkey,
const struct
GNUNET_CRYPTO_SymmetricInitializationVector *iv,
void *result);
@@ -577,7 +588,7 @@
* safely cast to char*, a '\\0' termination is set).
*/
void
-GNUNET_CRYPTO_hash_to_enc (const struct GNUNET_HashCode * block,
+GNUNET_CRYPTO_hash_to_enc (const struct GNUNET_HashCode *block,
struct GNUNET_CRYPTO_HashAsciiEncoded *result);
@@ -591,7 +602,8 @@
* @return #GNUNET_OK on success, #GNUNET_SYSERR if result has the wrong
encoding
*/
int
-GNUNET_CRYPTO_hash_from_string2 (const char *enc, size_t enclen,
+GNUNET_CRYPTO_hash_from_string2 (const char *enc,
+ size_t enclen,
struct GNUNET_HashCode *result);
@@ -662,8 +674,8 @@
*/
void
GNUNET_CRYPTO_hash_context_read (struct GNUNET_HashContext *hc,
- const void *buf,
- size_t size);
+ const void *buf,
+ size_t size);
/**
@@ -674,7 +686,7 @@
*/
void
GNUNET_CRYPTO_hash_context_finish (struct GNUNET_HashContext *hc,
- struct GNUNET_HashCode *r_hash);
+ struct GNUNET_HashCode *r_hash);
/**
@@ -697,8 +709,9 @@
*/
void
GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key,
- const void *plaintext, size_t plaintext_len,
- struct GNUNET_HashCode * hmac);
+ const void *plaintext,
+ size_t plaintext_len,
+ struct GNUNET_HashCode *hmac);
/**
@@ -732,7 +745,8 @@
*/
struct GNUNET_CRYPTO_FileHashContext *
GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority,
- const char *filename, size_t blocksize,
+ const char *filename,
+ size_t blocksize,
GNUNET_CRYPTO_HashCompletedCallback callback,
void *callback_cls);
@@ -902,7 +916,8 @@
void
GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key,
const struct GNUNET_CRYPTO_SymmetricSessionKey
*rkey,
- const void *salt, size_t salt_len, ...);
+ const void *salt, size_t salt_len,
+ ...);
/**
@@ -920,9 +935,15 @@
* @return #GNUNET_YES on success
*/
int
-GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo,
- const void *xts, size_t xts_len, const void *skm,
- size_t skm_len, ...);
+GNUNET_CRYPTO_hkdf (void *result,
+ size_t out_len,
+ int xtr_algo,
+ int prf_algo,
+ const void *xts,
+ size_t xts_len,
+ const void *skm,
+ size_t skm_len,
+ ...);
/**
@@ -940,9 +961,15 @@
* @return #GNUNET_YES on success
*/
int
-GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo,
- const void *xts, size_t xts_len, const void *skm,
- size_t skm_len, va_list argp);
+GNUNET_CRYPTO_hkdf_v (void *result,
+ size_t out_len,
+ int xtr_algo,
+ int prf_algo,
+ const void *xts,
+ size_t xts_len,
+ const void *skm,
+ size_t skm_len,
+ va_list argp);
/**
@@ -957,8 +984,12 @@
* @return #GNUNET_YES on success
*/
int
-GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts,
- size_t xts_len, const void *skm, size_t skm_len,
+GNUNET_CRYPTO_kdf_v (void *result,
+ size_t out_len,
+ const void *xts,
+ size_t xts_len,
+ const void *skm,
+ size_t skm_len,
va_list argp);
@@ -975,8 +1006,13 @@
* @return #GNUNET_YES on success
*/
int
-GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts,
- size_t xts_len, const void *skm, size_t skm_len, ...);
+GNUNET_CRYPTO_kdf (void *result,
+ size_t out_len,
+ const void *xts,
+ size_t xts_len,
+ const void *skm,
+ size_t skm_len,
+ ...);
/**
@@ -1002,8 +1038,23 @@
struct GNUNET_CRYPTO_EddsaPublicKey *pub);
+
/**
* @ingroup crypto
+ * Convert ECDSA public key to ECDHE public key.
+ * Please be very careful when using this function, as mixing
+ * cryptographic primitives is not always healthy.
+ *
+ * @param ecdsa ecdsa public key
+ * @param ecdhe[OUT] ecdhe public key
+ */
+void
+GNUNET_CRYPTO_ecdsa_public_to_ecdhe (const struct GNUNET_CRYPTO_EcdsaPublicKey
*ecdsa,
+ struct GNUNET_CRYPTO_EcdhePublicKey
*ecdhe);
+
+
+/**
+ * @ingroup crypto
* Extract the public key for the given private key.
*
* @param priv the private key
Modified: gnunet/src/include/gnunet_protocols.h
===================================================================
--- gnunet/src/include/gnunet_protocols.h 2015-03-19 13:12:47 UTC (rev
35406)
+++ gnunet/src/include/gnunet_protocols.h 2015-03-19 13:12:55 UTC (rev
35407)
@@ -521,7 +521,8 @@
/**
* P2P response with content or active migration of content. Also
- * used between the service and clients (in response to START_SEARCH).
+ * used between the service and clients (in response to
+ * #GNUNET_MESSAGE_TYPE_FS_START_SEARCH).
*/
#define GNUNET_MESSAGE_TYPE_FS_PUT 138
@@ -544,7 +545,6 @@
/*******************************************************************************
* DHT message types
******************************************************************************/
-
/**
* Client wants to store item in DHT.
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35407 - gnunet/src/include,
gnunet <=