2024-08-25 04:08:24 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QIODevice>
|
|
|
|
#include <QMessageAuthenticationCode>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qmessageauthenticationcode.h"
|
|
|
|
#include "gen_qmessageauthenticationcode.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QMessageAuthenticationCode* QMessageAuthenticationCode_new(uintptr_t method) {
|
|
|
|
return new QMessageAuthenticationCode(static_cast<QCryptographicHash::Algorithm>(method));
|
|
|
|
}
|
|
|
|
|
|
|
|
QMessageAuthenticationCode* QMessageAuthenticationCode_new2(uintptr_t method, QByteArray* key) {
|
|
|
|
return new QMessageAuthenticationCode(static_cast<QCryptographicHash::Algorithm>(method), *key);
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QMessageAuthenticationCode_Reset(QMessageAuthenticationCode* self) {
|
|
|
|
self->reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMessageAuthenticationCode_SetKey(QMessageAuthenticationCode* self, QByteArray* key) {
|
|
|
|
self->setKey(*key);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QMessageAuthenticationCode_AddData(QMessageAuthenticationCode* self, const char* data, int length) {
|
2024-08-25 04:08:24 +00:00
|
|
|
self->addData(data, static_cast<int>(length));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMessageAuthenticationCode_AddDataWithData(QMessageAuthenticationCode* self, QByteArray* data) {
|
|
|
|
self->addData(*data);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QMessageAuthenticationCode_AddDataWithDevice(QMessageAuthenticationCode* self, QIODevice* device) {
|
|
|
|
return self->addData(device);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QByteArray* QMessageAuthenticationCode_Result(const QMessageAuthenticationCode* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _ret = self->result();
|
2024-08-29 07:01:51 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QByteArray*>(new QByteArray(_ret));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray* QMessageAuthenticationCode_Hash(QByteArray* message, QByteArray* key, uintptr_t method) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _ret = QMessageAuthenticationCode::hash(*message, *key, static_cast<QCryptographicHash::Algorithm>(method));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QByteArray*>(new QByteArray(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMessageAuthenticationCode_Delete(QMessageAuthenticationCode* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|