Note that there are some explanatory texts on larger screens.

plurals
  1. PO128-bit type error
    primarykey
    data
    text
    <p>Thanks to pbos help and its program (published <a href="https://stackoverflow.com/questions/1656961/xor-on-a-very-big-file">here</a>, for xoring a big file), I performed some tests and I see that I have another problem: having changed the mask by another one of 128-bit, there is no default type as big as needed.</p> <p>I think a solution can be to include a library to increase available integer types... but rather that I prefer to interpret each 128 bits values such as strings. Is this possible without loosing performance?</p> <p>Here is the current program (with the bug "integer constant is too large for its type"):</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #define BLOCKSIZE 128 #define MASK 0xA37c54f173f02889a64be02f2bc44112 /* a 128 bits constant */ void usage(const char *cmd) { fprintf(stderr, "Usage: %s &lt;in-file&gt; [&lt;out-file&gt;]\n", cmd); exit (EXIT_FAILURE); } int main(int argc, char *argv[]) { if (argc &lt; 3) usage(argv[0]); FILE *in = fopen(argv[1], "rb"); if (in == NULL) { printf("Cannot open: %s", argv[2]); return EXIT_FAILURE; } FILE *out = fopen(argv[2], "wb"); if (out == NULL) { fclose(in); printf("Unable to open '%s' for writing.", argv[2]); } char buffer[BLOCKSIZE]; int count; while (count = fread(buffer, 1, BLOCKSIZE, in)) { int i; for (i = 0; i &lt; count; i++) { ((unsigned long *)buffer)[i] ^= MASK; /* this line is bugged */ } if (fwrite(buffer, 1, count, out) != count) { fclose(in); fclose(out); printf("Cannot write, disk full?\n"); return EXIT_FAILURE; } } fclose(in); fclose(out); return EXIT_SUCCESS; } </code></pre> <p>Thank for any suggestions.</p> <p>Doug</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload