Sha512 help.

T

Tosha

Can anyone please tell me what and when exatcly i need to convert from
little endian to big endian?

I load the file like this:

uint64 **matrix = (uint64**)malloc(block1024_count*sizeof(void*));
for (int i=0 ; i<block_c ; i++)
matrix = (uint64*)malloc(16*sizeof(uint64)); // Every block has 16
__int64 vars.

int index = 0;
while (fread(matrix[index],sizeof(uint64),16,fin)==16) // Fill the matrix
index++;

Now, do i need to convert this hole block as he was __int1024 varijable or
just every single 64 var one by one or maybe hole message somehow, and do i
need to convert those 80 constants and H[1-8] initial values? I tried many
things and i cant't get right hash.

Tnx.
 
T

TB

Tosha skrev:
Can anyone please tell me what and when exatcly i need to convert from
little endian to big endian?

The question here is: Do you really know the difference between the two?
I load the file like this:

uint64 **matrix = (uint64**)malloc(block1024_count*sizeof(void*));
for (int i=0 ; i<block_c ; i++)
matrix = (uint64*)malloc(16*sizeof(uint64)); // Every block has 16
__int64 vars.

int index = 0;
while (fread(matrix[index],sizeof(uint64),16,fin)==16) // Fill the matrix
index++;

Now, do i need to convert this hole block as he was __int1024 varijable or
just every single 64 var one by one or maybe hole message somehow, and do i
need to convert those 80 constants and H[1-8] initial values? I tried many
things and i cant't get right hash.


If you are the author of the file, then you should know in what format
you saved the data, otherwise ask the author.

(Are you sure it's C++ you're using?)
 
T

Tosha

TB said:
Tosha skrev:

The question here is: Do you really know the difference between the two?

Reason I asked this is because i did a conversion and i can't get the right
hash value. It's impossible not to know diffrence between B.E and L.E by
looking at one integer and it's 4 bytes, but looking at multiple 1024 bit
blocks where each is divided in 16 __int64, and hole message loaded with
fread like in code i posted, can be little unclear how fread distributes 128
bytes over the uint64[16] buffer.
I load the file like this:

uint64 **matrix = (uint64**)malloc(block1024_count*sizeof(void*));
for (int i=0 ; i<block_c ; i++)
matrix = (uint64*)malloc(16*sizeof(uint64)); // Every block has 16
__int64 vars.

int index = 0;
while (fread(matrix[index],sizeof(uint64),16,fin)==16) // Fill the matrix
index++;

Now, do i need to convert this hole block as he was __int1024 varijable
or
just every single 64 var one by one or maybe hole message somehow, and do
i
need to convert those 80 constants and H[1-8] initial values? I tried
many
things and i cant't get right hash.


If you are the author of the file, then you should know in what format
you saved the data, otherwise ask the author.

(Are you sure it's C++ you're using?)


Yes, i am using C++ compiler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top