little docs improvements

This commit is contained in:
Orson Peters 2013-02-04 18:04:05 +01:00
parent ae5f9678cb
commit 75216d602b

View File

@ -68,10 +68,9 @@ void ed25519_sign(unsigned char *signature,
const unsigned char *public_key, const unsigned char *private_key); const unsigned char *public_key, const unsigned char *private_key);
``` ```
Creates a signature of the given message with the keypair `(public_key, Creates a signature of the given message with the given key pair. `signature`
private_key)`. `signature` must be a writable 64 byte buffer. `message` must must be a writable 64 byte buffer. `message` must have at least `message_len`
have at least `message_len` bytes to be read. The given keypair must be a bytes to be read.
keypair generated by `ed25519_create_keypair`.
```c ```c
int ed25519_verify(const unsigned char *signature, int ed25519_verify(const unsigned char *signature,
@ -81,15 +80,18 @@ int ed25519_verify(const unsigned char *signature,
Verifies the signature on the given message using `public_key`. `signature` Verifies the signature on the given message using `public_key`. `signature`
must be a readable 64 byte buffer. `message` must have at least `message_len` must be a readable 64 byte buffer. `message` must have at least `message_len`
bytes to be read. `public_key` must be a 32 byte public key generated by bytes to be read. Returns 1 if the signature matches, 0 otherwise.
`ed25519_create_keypair`. Returns 1 if the signature matches, 0 otherwise.
```c ```c
void ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key, void ed25519_add_scalar(unsigned char *public_key, unsigned char *private_key,
const unsigned char *scalar); const unsigned char *scalar);
``` ```
Adds `scalar` to the given keypair where scalar is a 32 byte buffer (possibly generated with `ed25519_create_seed`), generating a new keypair. You can calculate the public key sum without knowing the private key and vice versa by passing in NULL. This is useful for enforcing randomness on a keypair while only knowing the public key, among other things. Adds `scalar` to the given key pair where scalar is a 32 byte buffer (possibly
generated with `ed25519_create_seed`), generating a new key pair. You can
calculate the public key sum without knowing the private key and vice versa by
passing in NULL for the key you don't know. This is useful for enforcing
randomness on a key pair while only knowing the public key, among other things.
Example Example
------- -------