Presently I am trying to port an encryption library written in C to Delphi. It is almost finished, however the C source code consists of the following instructions that I have not been able to cope with so far.
unsigned char one_block[16];
unsigned char * iv
((unsigned int *)one_block)[3] = ((unsigned int *) iv)[3];
...
I tried to convert it even as
var
one_block: Array[0..15] of Byte;
iv : PByte;
begin
PDWord(one_block[3]):= PDWord(iv[3]);
...
end;
but it obviously fails to compile, because the left side of the expression cannot be assigned.
Can anyone with more practice in porting give me a hint on how to solve this problem? Thank you in advance.
one_blockin both of your code snippets, with no indication of what it might be. You've also not assigned any value toivbefore trying to accessiv[3]. It's pretty difficult to try to port code when you haven't included the major parts.