Search:

Type: Posts; User: andydufresne

Search: Search took 0.02 seconds.

  1. lol gcc > mingw

    lol gcc > mingw
  2. Thanks guys. Weird thing is that mingw will...

    Thanks guys. Weird thing is that mingw will compile:



    int a[4];
    a = {1,2,3,4};


    but gcc 4.7 won't. Is there a bug with mingw that is allowing me to do this?
  3. Declare array then assign with a comma seperated list

    I know I can do this:


    int a[4] = {1,2,3,4};

    but I want to do this:



    int a[4];
  4. Replies
    20
    Views
    2,601

    Ah, thank you! I though I'd found some way of...

    Ah, thank you! I though I'd found some way of making my program much more efficient! BTW are there any suggestions you'd make about improving the performance of the substantive code?
  5. Replies
    20
    Views
    2,601

    Ah the answer seems to be that I was optimising...

    Ah the answer seems to be that I was optimising for speed and when the data is staying the same it makes it faster.
  6. Replies
    20
    Views
    2,601

    Both pieces of code are identical except for...

    Both pieces of code are identical except for where charstate is copied from. The lookup functions are executed in both.
  7. Replies
    20
    Views
    2,601

    Sorry, I find it a little difficult to understand...

    Sorry, I find it a little difficult to understand you. From the my above post is it clear why one piece of code is much faster? Is it, as I may think, that for the original piece of code the 2d array...
  8. Replies
    20
    Views
    2,601

    Ok, here is the original code looped from main...

    Ok, here is the original code looped from main 500000 times. It took 400 ms.



    void applymixcolumns (unsigned char charstate[][4],unsigned char multmatrix[][4])
    {
  9. Replies
    20
    Views
    2,601

    The difference between when I copy from test to...

    The difference between when I copy from test to charstate compared to tempstate to charstate is about 3* longer. The thing is that the stuff in between is happening anyway. The only think I'm...
  10. Replies
    20
    Views
    2,601

    I still don't think you need it but here it is...

    I still don't think you need it but here it is anyway:






    void applymixcolumns (unsigned char charstate[][4],unsigned char multmatrix[][4])
    {
  11. Replies
    20
    Views
    2,601

    The reason I need tempstate is that the function...

    The reason I need tempstate is that the function continually changes the 2d array and the operations performed depend on the original version of the 2d array.

    Tried to memcpy to no effect.
  12. Replies
    20
    Views
    2,601

    Urgh. The second piece of code is much faster. ...

    Urgh. The second piece of code is much faster.

    This is my actual code:





    void applymixcolumns (unsigned char charstate[][4],unsigned char multmatrix[][4])
    {
  13. Replies
    20
    Views
    2,601

    Thanks for the reply but I'm confused why this...

    Thanks for the reply but I'm confused why this code is much much quicker :





    unsigned char test[4][4];


    //recopy temp into charstate
  14. Replies
    20
    Views
    2,601

    Taking forever to copy 2d array

    So I have a function which takes in a 2d array as a parameter and sets its value by copying another (locally declared) 2d array like this (both 2d arrays of unsigned chars):



    for (int...
  15. Replies
    1
    Views
    1,228

    aes implementation

    I've been implementing the aes algorithm. It works fine in theory (block encryption and decryption) but I'm struggling to use it to encrypt files. The block is composed of 16 by 16 unsigned chars (as...
  16. Replies
    3
    Views
    4,152

    Ah, of course. Do you have any ideas about...

    Ah, of course.

    Do you have any ideas about the best way of splitting up the message into chunks <n ?

    Thanks!
  17. Replies
    3
    Views
    4,152

    GMP RSA implementation

    I'm trying to implement the RSA algorithm (just for fun, with no padding). My code works fine encrypting up to 83 characters but after this the decryption output is only gibberish and (no matter the...
  18. Ah, sorry about that. Still doesn't work with ...

    Ah, sorry about that. Still doesn't work with mpf_mul_ui (x,x,2);
  19. pi program using arbitrary precision (GMP)

    HI everyone,

    I'm trying to make a program to compute pi to n places. I'm using the Gauss Legendre (Gauss-Legendre Algorithm -- from Harry J. Smith).
    I'm using the GMP MP package for arbitrary...
Results 1 to 19 of 19