@@ -15,35 +15,39 @@ extern const unsigned int SHA_CONTEXT_SIZE;
15
15
16
16
/**
17
17
* 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
20
21
*/
21
22
extern int sha512_init (void * context );
22
23
23
24
/**
24
25
* 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
29
31
*/
30
32
extern int sha512_update (void * context , const unsigned char * in ,
31
33
unsigned long long inlen );
32
34
33
35
/**
34
36
* 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
38
41
*/
39
42
extern int sha512_final (void * context , unsigned char * out );
40
43
41
44
/**
42
45
* 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
47
51
*/
48
52
extern int sha512 (unsigned char * out , const unsigned char * message ,
49
53
unsigned long long message_len );
0 commit comments