Skip to content

Commit 1a174e4

Browse files
committed
Fix documentation
1 parent 371a15c commit 1a174e4

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

include/ed25519/ed25519.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ typedef struct { unsigned char data[ed25519_privkey_SIZE]; } private_key_t;
2121
* @brief Generates a keypair. Depends on randombytes.h random generator.
2222
* @param[out] sk allocated buffer of ed25519_privkey_SIZE
2323
* @param[out] pk allocated buffer of ed25519_pubkey_SIZE
24-
* @return 0 if success, non-0 otherwise
24+
* @return 1 if success, non-0 otherwise
2525
*/
2626
int ed25519_create_keypair(private_key_t* sk, public_key_t* pk);
2727

include/ed25519/randombytes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ extern "C" {
77

88
/**
99
* Fills preallocated buffer p of length len with random data.
10-
* @param p buffer of length len
11-
* @param len length
12-
* @return 0 if success, non-0 otherwise
10+
* @param[out] p buffer of length len
11+
* @param[in] len length
12+
* @return 1 if success, non-0 otherwise
1313
* @note You should always check return code of randombytes
1414
*/
1515
extern int randombytes(unsigned char *p, int len);

include/ed25519/sha512.h

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,39 @@ extern const unsigned int SHA_CONTEXT_SIZE;
1515

1616
/**
1717
* Initializes context with specific for implementation size.
18-
* @param context always pass preallocated buffer of SHA_CONTEXT_SIZE;
19-
* @return 0 if success, non-0 otherwise.
18+
* @param[in] context always pass preallocated buffer of SHA_CONTEXT_SIZE;
19+
* @return 0 if error, non-0 otherwise.
20+
* @note some implementations may return bad code sometimes, some may not
2021
*/
2122
extern int sha512_init(void *context);
2223

2324
/**
2425
* Updates hash state with given buffer
25-
* @param context always pass preallocated buffer of SHA_CONTEXT_SIZE;
26-
* @param in input buffer with info to be hashed
27-
* @param inlen buffer size
28-
* @return 0 if success, non-0 otherwise
26+
* @param[in] context always pass preallocated buffer of SHA_CONTEXT_SIZE;
27+
* @param[in] in input buffer with info to be hashed
28+
* @param[in] inlen buffer size
29+
* @return 0 if error, non-0 otherwise
30+
* @note some implementations may return bad code sometimes, some may not
2931
*/
3032
extern int sha512_update(void *context, const unsigned char *in,
3133
unsigned long long inlen);
3234

3335
/**
3436
* Finish hash calculation. Use this to store hash in output buffer (out).
35-
* @param context always pass preallocated buffer of SHA_CONTEXT_SIZE;
36-
* @param out output buffer of exactly SHA_512_SIZE bytes
37-
* @return 0 if success, non-0 otherwise
37+
* @param[in] context always pass preallocated buffer of SHA_CONTEXT_SIZE;
38+
* @param[in] out output buffer of exactly SHA_512_SIZE bytes
39+
* @return 0 if error, non-0 otherwise
40+
* @note some implementations may return bad code sometimes, some may not
3841
*/
3942
extern int sha512_final(void *context, unsigned char *out);
4043

4144
/**
4245
* Inline hash calculation of sha512.
43-
* @param out output buffer of exactly SHA_512_SIZE bytes
44-
* @param message message buffer to be hashed
45-
* @param message_len size of the message buffer
46-
* @return 0 if success, non-0 otherwise
46+
* @param[out] out output buffer of exactly SHA_512_SIZE bytes
47+
* @param[in] message message buffer to be hashed
48+
* @param[in] message_len size of the message buffer
49+
* @return 0 if error, non-0 otherwise
50+
* @note some implementations may return bad code sometimes, some may not
4751
*/
4852
extern int sha512(unsigned char *out, const unsigned char *message,
4953
unsigned long long message_len);

0 commit comments

Comments
 (0)