summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-07 17:51:59 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-07 17:51:59 +0200
commit29bd17729dd74080e0070f09654690200c1e11ae (patch)
tree5404788fe7a09888c8ea19b8a54e0dae7299f32a /src/util
parent90d63f8249736f9717ca0467d4e8fb9d3d8b48b4 (diff)
improve comments (#6164)
Diffstat (limited to 'src/util')
-rw-r--r--src/util/crypto_ecc.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c
index fcc8efa2c..d2cbe9450 100644
--- a/src/util/crypto_ecc.c
+++ b/src/util/crypto_ecc.c
@@ -676,7 +676,11 @@ data_to_ecdsa_value (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose)
/**
- * Sign a given block.
+ * Sign a given block. The @a purpose data is the
+ * beginning of the data of which the signature is to be
+ * created. The `size` field in @a purpose must correctly
+ * indicate the number of bytes of the data structure, including
+ * its header.
*
* @param priv private key to use for the signing
* @param purpose what to sign (size, purpose)
@@ -734,7 +738,11 @@ GNUNET_CRYPTO_ecdsa_sign (
/**
- * Sign a given block.
+ * Sign a given block. The @a purpose data is the
+ * beginning of the data of which the signature is to be
+ * created. The `size` field in @a purpose must correctly
+ * indicate the number of bytes of the data structure, including
+ * its header.
*
* @param priv private key to use for the signing
* @param purpose what to sign (size, purpose)
@@ -764,7 +772,12 @@ GNUNET_CRYPTO_eddsa_sign (
/**
- * Verify signature.
+ * Verify signature. The @a validate data is the
+ * beginning of the data of which the signature is to be
+ * verified. The `size` field in @a validate must correctly
+ * indicate the number of bytes of the data structure, including
+ * its header. If @a purpose does not match the purpose given
+ * in @a validate (the latter
*
* @param purpose what is the purpose that the signature should have?
* @param validate block to validate (size, purpose, data)
@@ -832,7 +845,13 @@ GNUNET_CRYPTO_ecdsa_verify (
/**
- * Verify signature.
+ * Verify signature. The @a validate data is the
+ * beginning of the data of which the signature is to be
+ * verified. The `size` field in @a validate must correctly
+ * indicate the number of bytes of the data structure, including
+ * its header. If @a purpose does not match the purpose given
+ * in @a validate (the latter must be in big endian), signature
+ * verification fails.
*
* @param purpose what is the purpose that the signature should have?
* @param validate block to validate (size, purpose, data)