return -1;
}
- if (*resultlen == 0) {
+ if (resultlen == NULL) {
+ return 0;
+ } else if (*resultlen == 0) {
*resultlen = ret;
*result = g_new0(uint8_t, *resultlen);
} else if (*resultlen != ret) {
return -1;
}
- if (*resultlen == 0) {
+ if (resultlen == NULL) {
+ return 0;
+ } else if (*resultlen == 0) {
*resultlen = ret;
*result = g_new0(uint8_t, *resultlen);
} else if (*resultlen != ret) {
return -1;
}
- if (*resultlen == 0) {
+ if (resultlen == NULL) {
+ return 0;
+ } else if (*resultlen == 0) {
*resultlen = ret;
*result = g_new0(uint8_t, *resultlen);
} else if (*resultlen != ret) {
}
}
- if (*resultlen == 0) {
+ if (resultlen == NULL) {
+ return 0;
+ } else if (*resultlen == 0) {
*resultlen = qcrypto_hmac_alg_map[hmac->alg].len;
*result = g_new0(uint8_t, *resultlen);
} else if (*resultlen != qcrypto_hmac_alg_map[hmac->alg].len) {
* The memory referenced in @result must be released with a call
* to g_free() when no longer required by the caller.
*
+ * If @result_len is set to a NULL pointer, no result will be returned, and
+ * the hmac object can be used for further invocations of qcrypto_hmac_bytes()
+ * or qcrypto_hmac_bytesv() until a non-NULL pointer is provided. This allows
+ * to build the hmac across memory regions that are not available at the same
+ * time.
+ *
* Returns:
* 0 on success, -1 on error
*/
* The memory referenced in @result must be released with a call
* to g_free() when no longer required by the caller.
*
+ * If @result_len is set to a NULL pointer, no result will be returned, and
+ * the hmac object can be used for further invocations of qcrypto_hmac_bytes()
+ * or qcrypto_hmac_bytesv() until a non-NULL pointer is provided. This allows
+ * to build the hmac across memory regions that are not available at the same
+ * time.
+ *
* Returns:
* 0 on success, -1 on error
*/