2024-08-25 16:08:24 +12:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QIODevice>
|
|
|
|
#include <QMessageAuthenticationCode>
|
2024-08-29 19:01:51 +12:00
|
|
|
#include "qmessageauthenticationcode.h"
|
|
|
|
#include "gen_qmessageauthenticationcode.h"
|
2024-09-15 10:29:05 +12:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 16:08:24 +12:00
|
|
|
|
2024-09-18 12:12:02 +12:00
|
|
|
QMessageAuthenticationCode* QMessageAuthenticationCode_new(int method) {
|
2024-08-29 19:01:51 +12:00
|
|
|
return new QMessageAuthenticationCode(static_cast<QCryptographicHash::Algorithm>(method));
|
|
|
|
}
|
|
|
|
|
2024-09-18 12:12:02 +12:00
|
|
|
QMessageAuthenticationCode* QMessageAuthenticationCode_new2(int method, QByteArray* key) {
|
2024-08-29 19:01:51 +12:00
|
|
|
return new QMessageAuthenticationCode(static_cast<QCryptographicHash::Algorithm>(method), *key);
|
|
|
|
}
|
|
|
|
|
2024-08-25 16:08:24 +12:00
|
|
|
void QMessageAuthenticationCode_Reset(QMessageAuthenticationCode* self) {
|
|
|
|
self->reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMessageAuthenticationCode_SetKey(QMessageAuthenticationCode* self, QByteArray* key) {
|
|
|
|
self->setKey(*key);
|
|
|
|
}
|
|
|
|
|
2024-08-29 19:01:51 +12:00
|
|
|
void QMessageAuthenticationCode_AddData(QMessageAuthenticationCode* self, const char* data, int length) {
|
2024-08-25 16:08:24 +12: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 17:41:09 +12:00
|
|
|
QByteArray* QMessageAuthenticationCode_Result(const QMessageAuthenticationCode* self) {
|
2024-09-17 18:29:11 +12:00
|
|
|
return new QByteArray(self->result());
|
2024-08-29 19:01:51 +12:00
|
|
|
}
|
|
|
|
|
2024-09-18 12:12:02 +12:00
|
|
|
QByteArray* QMessageAuthenticationCode_Hash(QByteArray* message, QByteArray* key, int method) {
|
2024-09-17 18:29:11 +12:00
|
|
|
return new QByteArray(QMessageAuthenticationCode::hash(*message, *key, static_cast<QCryptographicHash::Algorithm>(method)));
|
2024-08-25 16:08:24 +12:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMessageAuthenticationCode_Delete(QMessageAuthenticationCode* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|