Browse Source

Improve comments&doc

[skip ci]
Steffen Jaeckel 6 years ago
parent
commit
3da27d71a0

+ 7 - 3
doc/crypt.tex

@@ -5732,7 +5732,9 @@ compatible to each other.
 It is possible to convert a Curve-Key to an Ed-Key and vice-versa, but this is not provided (yet).
 It is possible to convert a Curve-Key to an Ed-Key and vice-versa, but this is not provided (yet).
 
 
 
 
-\mysection{Curve25519 Diffie-Hellman Key Exchange - X25519}
+\mysection{Curve25519-based Diffie-Hellman Key Exchange - X25519}
+
+The library provides the Diffie-Hellman Key Exchange algorithm \textit{X25519} for curve25519 as specified in RFC 7748.
 
 
 \subsection{X25519 Key Operations}
 \subsection{X25519 Key Operations}
 
 
@@ -5816,9 +5818,11 @@ int x25519_shared_secret(const curve25519_key *private_key,
                                 unsigned char *out, unsigned long *outlen);
                                 unsigned char *out, unsigned long *outlen);
 \end{verbatim}
 \end{verbatim}
 
 
-This will construct the shared secret between the private and the public key and store the result in \textit{out} of length \textit{outlen}.
+This will construct the shared secret between the private- and the public-key and store the result in \textit{out} of length \textit{outlen}.
+
+\mysection{Curve25519-based EdDSA Signature Scheme - Ed25519}
 
 
-\mysection{Curve25519 Signature Scheme - EdDSA}
+The library provides the EdDSA algorithm for the edwards25519 curve in the PureEdDSA variant as specified in RFC 8032.
 
 
 \subsection{EdDSA Key Operations}
 \subsection{EdDSA Key Operations}
 
 

+ 2 - 2
src/pk/ec25519/ec25519_export.c

@@ -9,8 +9,8 @@
 #include "tomcrypt_private.h"
 #include "tomcrypt_private.h"
 
 
 /**
 /**
-  @file ed25519_export.c
-  Export a Ed25519 key to a binary packet, Steffen Jaeckel
+  @file ec25519_export.c
+  Generic export of a Curve/Ed25519 key to a binary packet, Steffen Jaeckel
 */
 */
 
 
 #ifdef LTC_CURVE25519
 #ifdef LTC_CURVE25519

+ 2 - 2
src/pk/ed25519/ed25519_export.c

@@ -10,13 +10,13 @@
 
 
 /**
 /**
   @file ed25519_export.c
   @file ed25519_export.c
-  Export a Ed25519 key to a binary packet, Steffen Jaeckel
+  Export an Ed25519 key to a binary packet, Steffen Jaeckel
 */
 */
 
 
 #ifdef LTC_CURVE25519
 #ifdef LTC_CURVE25519
 
 
 /**
 /**
-   Export a Ed25519 key to a binary packet
+   Export an Ed25519 key to a binary packet
    @param out    [out] The destination for the key
    @param out    [out] The destination for the key
    @param outlen [in/out] The max size and resulting size of the Ed25519 key
    @param outlen [in/out] The max size and resulting size of the Ed25519 key
    @param type   Which type of key (PK_PRIVATE, PK_PUBLIC|PK_STD or PK_PUBLIC)
    @param type   Which type of key (PK_PRIVATE, PK_PUBLIC|PK_STD or PK_PUBLIC)

+ 2 - 2
src/pk/ed25519/ed25519_import_pkcs8.c

@@ -10,13 +10,13 @@
 
 
 /**
 /**
   @file ed25519_import_pkcs8.c
   @file ed25519_import_pkcs8.c
-  Import a Ed25519 key in PKCS#8 format, Steffen Jaeckel
+  Import an Ed25519 key in PKCS#8 format, Steffen Jaeckel
 */
 */
 
 
 #ifdef LTC_CURVE25519
 #ifdef LTC_CURVE25519
 
 
 /**
 /**
-  Import a Ed25519 private key in PKCS#8 format
+  Import an Ed25519 private key in PKCS#8 format
   @param in        The DER-encoded PKCS#8-formatted private key
   @param in        The DER-encoded PKCS#8-formatted private key
   @param inlen     The length of the input data
   @param inlen     The length of the input data
   @param passwd    The password to decrypt the private key
   @param passwd    The password to decrypt the private key

+ 2 - 2
src/pk/ed25519/ed25519_import_x509.c

@@ -10,7 +10,7 @@
 
 
 /**
 /**
   @file ed25519_import_x509.c
   @file ed25519_import_x509.c
-  Import a Ed25519 key from a X.509 certificate, Steffen Jaeckel
+  Import an Ed25519 key from a X.509 certificate, Steffen Jaeckel
 */
 */
 
 
 #ifdef LTC_CURVE25519
 #ifdef LTC_CURVE25519
@@ -23,7 +23,7 @@ static int _ed25519_decode(const unsigned char *in, unsigned long inlen, curve25
 }
 }
 
 
 /**
 /**
-  Import a Ed25519 public key from a X.509 certificate
+  Import an Ed25519 public key from a X.509 certificate
   @param in     The DER encoded X.509 certificate
   @param in     The DER encoded X.509 certificate
   @param inlen  The length of the certificate
   @param inlen  The length of the certificate
   @param key    [out] Where to import the key to
   @param key    [out] Where to import the key to

+ 2 - 2
src/pk/ed25519/ed25519_make_key.c

@@ -10,13 +10,13 @@
 
 
 /**
 /**
   @file ed25519_make_key.c
   @file ed25519_make_key.c
-  Create a Ed25519 key, Steffen Jaeckel
+  Create an Ed25519 key, Steffen Jaeckel
 */
 */
 
 
 #ifdef LTC_CURVE25519
 #ifdef LTC_CURVE25519
 
 
 /**
 /**
-   Create a Ed25519 key
+   Create an Ed25519 key
    @param prng     An active PRNG state
    @param prng     An active PRNG state
    @param wprng    The index of the PRNG desired
    @param wprng    The index of the PRNG desired
    @param key      [out] Destination of a newly created private key pair
    @param key      [out] Destination of a newly created private key pair

+ 2 - 2
src/pk/ed25519/ed25519_set_key.c

@@ -10,13 +10,13 @@
 
 
 /**
 /**
   @file ed25519_set_ku.c
   @file ed25519_set_ku.c
-  Set the parameters of a Ed25519 key, Steffen Jaeckel
+  Set the parameters of an Ed25519 key, Steffen Jaeckel
 */
 */
 
 
 #ifdef LTC_CURVE25519
 #ifdef LTC_CURVE25519
 
 
 /**
 /**
-   Set the parameters of a Ed25519 key
+   Set the parameters of an Ed25519 key
 
 
    In case sk and pk are given it is validated that pk is really the
    In case sk and pk are given it is validated that pk is really the
    corresponding public part of the key pair.
    corresponding public part of the key pair.

+ 4 - 4
src/pk/ed25519/ed25519_sign.c

@@ -10,15 +10,15 @@
 
 
 /**
 /**
   @file ed25519_shared_secret.c
   @file ed25519_shared_secret.c
-  Create a Ed25519 signature, Steffen Jaeckel
+  Create an Ed25519 signature, Steffen Jaeckel
 */
 */
 
 
 #ifdef LTC_CURVE25519
 #ifdef LTC_CURVE25519
 
 
 /**
 /**
-   Create a Ed25519 signature.
-   @param private_key     The private ed25519 key in the pair
-   @param public_key      The public ed25519 key in the pair
+   Create an Ed25519 signature.
+   @param private_key     The private Ed25519 key in the pair
+   @param public_key      The public Ed25519 key in the pair
    @param out             [out] The destination of the shared data
    @param out             [out] The destination of the shared data
    @param outlen          [in/out] The max size and resulting size of the shared data.
    @param outlen          [in/out] The max size and resulting size of the shared data.
    @return CRYPT_OK if successful
    @return CRYPT_OK if successful

+ 4 - 4
src/pk/ed25519/ed25519_verify.c

@@ -10,15 +10,15 @@
 
 
 /**
 /**
   @file ed25519_verify.c
   @file ed25519_verify.c
-  Verify a Ed25519 signature, Steffen Jaeckel
+  Verify an Ed25519 signature, Steffen Jaeckel
 */
 */
 
 
 #ifdef LTC_CURVE25519
 #ifdef LTC_CURVE25519
 
 
 /**
 /**
-   Verify a Ed25519 signature.
-   @param private_key     The private curve25519 key in the pair
-   @param public_key      The public curve25519 key in the pair
+   Verify an Ed25519 signature.
+   @param private_key     The private Ed25519 key in the pair
+   @param public_key      The public Ed25519 key in the pair
    @param out             [out] The destination of the shared data
    @param out             [out] The destination of the shared data
    @param outlen          [in/out] The max size and resulting size of the shared data.
    @param outlen          [in/out] The max size and resulting size of the shared data.
    @param stat            [out] The result of the signature verification, 1==valid, 0==invalid
    @param stat            [out] The result of the signature verification, 1==valid, 0==invalid

+ 2 - 2
src/pk/x25519/x25519_shared_secret.c

@@ -17,8 +17,8 @@
 
 
 /**
 /**
    Create a X25519 shared secret.
    Create a X25519 shared secret.
-   @param private_key     The private Curve25519 key in the pair
-   @param public_key      The public Curve25519 key in the pair
+   @param private_key     The private X25519 key in the pair
+   @param public_key      The public X25519 key in the pair
    @param out             [out] The destination of the shared data
    @param out             [out] The destination of the shared data
    @param outlen          [in/out] The max size and resulting size of the shared data.
    @param outlen          [in/out] The max size and resulting size of the shared data.
    @return CRYPT_OK if successful
    @return CRYPT_OK if successful