Shop OBEX P1 Docs P2 Docs Learn Events
Aes256 — Parallax Forums

Aes256

ReinhardReinhard Posts: 489
edited 2011-12-05 20:22 in Propeller 1
Because my daily work with crypto stuff, today I found this C code

http://www.literatecode.com/aes256

compiled without any modifications under propgcc .... and run successfull !

Comments

  • Dave HeinDave Hein Posts: 6,347
    edited 2011-12-05 14:44
    Very nice!
  • ReinhardReinhard Posts: 489
    edited 2011-12-05 15:34
    Well, this can open many doors for the chip.

    Btw. in this code I see quite often the modifier register. Use the compiler really a cogregister for the variable or is this more a proposal ?
  • Heater.Heater. Posts: 21,230
    edited 2011-12-05 20:00
    R
    "register" is only a suggestion to the compiler that the variable can be placed in a register for some optimization. The compiler need not actually do that. For example if the target machine is stack based with no registers.
    If you can get the "register" vars to live in cog all the better.
  • Dave HeinDave Hein Posts: 6,347
    edited 2011-12-05 20:22
    PropGCC uses 16 cog registers. As Heater said, the register keyword is a suggestion to the compiler to keep the variable in a register. You can run "propeller-elf-gcc -S file.c" to generate the file.s assembly file. You can look at the assembly file to see if the compiler kept the variable in a register. The optimizer does a good job of keeping variables in registers even without using the register keyword.
Sign In or Register to comment.