int qcrypto_hash_bytes(QCryptoHashAlgo alg,
- const char *buf,
+ const void *buf,
size_t len,
uint8_t **result,
size_t *resultlen,
Error **errp)
{
- struct iovec iov = { .iov_base = (char *)buf,
+ struct iovec iov = { .iov_base = (void *)buf,
.iov_len = len };
return qcrypto_hash_bytesv(alg, &iov, 1, result, resultlen, errp);
}
}
int qcrypto_hash_update(QCryptoHash *hash,
- const char *buf,
+ const void *buf,
size_t len,
Error **errp)
{
- struct iovec iov = { .iov_base = (char *)buf, .iov_len = len };
+ struct iovec iov = { .iov_base = (void *)buf, .iov_len = len };
return qcrypto_hash_updatev(hash, &iov, 1, errp);
}
}
int qcrypto_hash_digest(QCryptoHashAlgo alg,
- const char *buf,
+ const void *buf,
size_t len,
char **digest,
Error **errp)
{
- struct iovec iov = { .iov_base = (char *)buf, .iov_len = len };
+ struct iovec iov = { .iov_base = (void *)buf, .iov_len = len };
return qcrypto_hash_digestv(alg, &iov, 1, digest, errp);
}
}
int qcrypto_hash_base64(QCryptoHashAlgo alg,
- const char *buf,
+ const void *buf,
size_t len,
char **base64,
Error **errp)
{
- struct iovec iov = { .iov_base = (char *)buf, .iov_len = len };
+ struct iovec iov = { .iov_base = (void *)buf, .iov_len = len };
return qcrypto_hash_base64v(alg, &iov, 1, base64, errp);
}
}
int qcrypto_hmac_bytes(QCryptoHmac *hmac,
- const char *buf,
+ const void *buf,
size_t len,
uint8_t **result,
size_t *resultlen,
Error **errp)
{
struct iovec iov = {
- .iov_base = (char *)buf,
+ .iov_base = (void *)buf,
.iov_len = len
};
}
int qcrypto_hmac_digest(QCryptoHmac *hmac,
- const char *buf,
+ const void *buf,
size_t len,
char **digest,
Error **errp)
{
struct iovec iov = {
- .iov_base = (char *)buf,
+ .iov_base = (void *)buf,
.iov_len = len
};
* Returns: 0 on success, -1 on error
*/
int qcrypto_hash_bytes(QCryptoHashAlgo alg,
- const char *buf,
+ const void *buf,
size_t len,
uint8_t **result,
size_t *resultlen,
* Returns: 0 on success, -1 on error
*/
int qcrypto_hash_update(QCryptoHash *hash,
- const char *buf,
+ const void *buf,
size_t len,
Error **errp);
* Returns: 0 on success, -1 on error
*/
int qcrypto_hash_digest(QCryptoHashAlgo alg,
- const char *buf,
+ const void *buf,
size_t len,
char **digest,
Error **errp);
* Returns: 0 on success, -1 on error
*/
int qcrypto_hash_base64(QCryptoHashAlgo alg,
- const char *buf,
+ const void *buf,
size_t len,
char **base64,
Error **errp);
* 0 on success, -1 on error
*/
int qcrypto_hmac_bytes(QCryptoHmac *hmac,
- const char *buf,
+ const void *buf,
size_t len,
uint8_t **result,
size_t *resultlen,
* Returns: 0 on success, -1 on error
*/
int qcrypto_hmac_digest(QCryptoHmac *hmac,
- const char *buf,
+ const void *buf,
size_t len,
char **digest,
Error **errp);