Added return value documentation
@@ -34,7 +34,7 @@ extern "C" {
* Append HMAC to packet
* @param packet Pointer to packet
* @param include_header use header in hmac calculation (this will not modify the flags field)
- * @return 0 on success, -1 on failure
+ * @return 0 on success, negative on failure
*/
int csp_hmac_append(csp_packet_t * packet, bool include_header);
@@ -42,7 +42,7 @@ int csp_hmac_append(csp_packet_t * packet, bool include_header);
* Verify HMAC of packet
* @param packet Pointer to packet
* @param include_header use header in hmac calculation (this will not modify the flags field)
- * @return 0 on correct HMAC, -1 if verification failed
+ * @return 0 on success, negative on failure
*/
int csp_hmac_verify(csp_packet_t * packet, bool include_header);
@@ -55,6 +55,7 @@ int csp_hmac_verify(csp_packet_t * packet, bool include_header);
* @param data pointer to data
* @param datalen lehgth of data
* @param hmac output HMAC calculation (CSP_HMAC_LENGTH)
+ * @return 0 on success, negative on failure
*/
int csp_hmac_memory(const uint8_t * key, uint32_t keylen, const uint8_t * data, uint32_t datalen, uint8_t * hmac);
@@ -62,6 +63,7 @@ int csp_hmac_memory(const uint8_t * key, uint32_t keylen, const uint8_t * data,
* Save a copy of the key string for use by the append/verify functions
* @param key HMAC key
* @param keylen HMAC key length
+ * @return Always returns 0
*/
int csp_hmac_set_key(char * key, uint32_t keylen);
