Skip to content

Commit f4576de

Browse files
committed
progress with no progress :(
1 parent 2037e0b commit f4576de

11 files changed

+19
-20
lines changed

quark/cquark_test

0 Bytes
Binary file not shown.

quark/cquark_test_debug

40 Bytes
Binary file not shown.

quark/create_quark

0 Bytes
Binary file not shown.

quark/dquark_test

0 Bytes
Binary file not shown.

quark/dquark_test_debug

24 Bytes
Binary file not shown.

quark/empty_file

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

quark/main.c

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,50 +22,47 @@
2222
typedef uint64_t u64;
2323
typedef uint8_t u8;
2424

25-
int quark( u8 *out, const u8 *in, u64 inlen );
26-
27-
28-
// test quark hashing
29-
int test_vectors()
30-
{
31-
u8 out[MAXDIGEST];
3225

33-
// quark( out, NULL, 0 );
34-
35-
// return memcmp( out, digest_empty, sizeof( digest_empty ) );
36-
}
26+
// the quark function definition
27+
int quark( u8 *out, const u8 *in, u64 inlen );
3728

3829

30+
// the main function
3931
int main(int argc, char* argv[])
4032
{
4133
// essential variables
34+
u8 out[MAXDIGEST];
4235
long file_size;
4336
int i;
4437

4538
// read the file
4639
if(argc > 1)
4740
{
4841
// create the file pointer
49-
FILE *file_pointer;
50-
file_pointer = fopen(argv[1], "rb");
42+
FILE *file_pointer = fopen(argv[1], "rb");
5143

5244
// find the file length
5345
fseek(file_pointer, 0, SEEK_END);
5446
file_size = ftell(file_pointer);
5547
fseek(file_pointer, 0, SEEK_SET);
5648

5749
// read the file contents
58-
char *file_contents = malloc(file_size + 1);
50+
u8 *file_contents = malloc(file_size + 1);
5951
fread(file_contents, file_size, 1, file_pointer);
52+
fclose(file_pointer);
53+
54+
// debug
55+
u8 dummy_data[5] = {0x03, 0x25, 0x62, 0x14, 0xb9};
56+
quark(out, dummy_data, 5);
6057

61-
// convert contents to integer array
62-
u8 *digest_input = malloc(file_size + 1);
63-
for(i = 0; i < file_size; ++i)
58+
// try to create hash
59+
// quark(out, file_contents, file_size + 1);
60+
61+
for(i=0; i<MAXDIGEST; ++i)
6462
{
65-
digest_input = file_contents;
66-
++file_contents;
67-
++digest_input;
63+
printf("%d", out[i]);
6864
}
65+
printf("\n");
6966
}
7067

7168
return 0;

quark/squark_test

0 Bytes
Binary file not shown.

quark/squark_test_debug

40 Bytes
Binary file not shown.

quark/test_file

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
HELLO

quark/uquark_test_debug

24 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)