-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.cpp
54 lines (42 loc) · 1.55 KB
/
mainwindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "tiger.c"
#include "stdio.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
word64 buffer[65536];
word64 res[3];
int i;
for (i=0;i<65536;i++)
buffer[i] = i&0xFF;
tiger(buffer, 65536, res);
// sadsadasdsdas
//// qDebug(QString("%1").arg((long)res).toAscii());
// printf("Hash of a 64K-byte string:\n\t%08X%08X %08X%08X %08X%08X\n",
// (word32)(res[0]>>32),
// (word32)(res[0]),
// (word32)(res[1]>>32),
// (word32)(res[1]),
// (word32)(res[2]>>32),
// (word32)(res[2]) );
// tiger((word64*)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-", strlen("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-"), res);
QString str;
str = QString("Hash of a 64K-byte string:\n\t%1%2 %3%4 %5%6\n")
.arg((word32)(res[0]>>32),0,16)
.arg((word32)res[0],0,16)
.arg((word32)(res[1]>>32),0,16)
.arg((word32)res[1],0,16)
.arg((word32)(res[2]>>32),0,16)
.arg((word32)res[2],0,16);
str = QString("Hash of a 64K-byte string:\n\t%1 %2 %3\n")
.arg(res[0],0,16)
.arg(res[1],0,16)
.arg(res[2],0,16);
qDebug(str.toAscii());
}
MainWindow::~MainWindow() {
delete ui;
}