Difference between revisions of "Present python implementation"

From YobiWiki
Jump to navigation Jump to search
m
m (deleted comments from during development)
 
Line 3: Line 3:
 
The code is available [http://repo.or.cz/w/python-cryptoplus.git?a=blob;f=src/CryptoPlus/Cipher/pypresent.py;hb=HEAD here]
 
The code is available [http://repo.or.cz/w/python-cryptoplus.git?a=blob;f=src/CryptoPlus/Cipher/pypresent.py;hb=HEAD here]
   
  +
Features:
what should be working (only tested with 1 or 2 test vectors yet):
 
 
* calculating round keys
 
* calculating round keys
** to have the same results as the reference C implementation, salting the roundkeys should only XOR 5 bits with roundkey when using 128bits key (line 95 in code) but should XOR with no 5bits limit when using 80bits key (line 76 in code). But the standard describes that it should be limited to 5 bits for both key generators...
 
 
* encrypting a block
 
* encrypting a block
 
* decrypting a block
 
* decrypting a block
  +
* supports amount of rounds different from the standard amount of 32
* should support rounds up to 65534 (tested with 32, 64, 128 and 65534 rounds)
+
** tested with 32, 64, 128 and 65534 rounds
** decryption testvectors have errors: the sbox on decryption behaves like the inverse of the p-box... every S-Box value is incorrect in the testvectors.<br>Example:
 
  +
** PRESENT reference implementation supports amount of rounds up to 65534
Round 1
 
Subkey: 6dab31744f41d700
 
Text after...
 
...Key-Xor: 38d2f04c34635345
 
.....P-Box: 45ef82118f2845a3
 
.....S-Box: 38d2f04c34635345
 

Latest revision as of 01:00, 16 October 2008

This is a development done by Christophe Oosterlynck under my supervision during his thesis work & internship at NXP.

The code is available here

Features:

  • calculating round keys
  • encrypting a block
  • decrypting a block
  • supports amount of rounds different from the standard amount of 32
    • tested with 32, 64, 128 and 65534 rounds
    • PRESENT reference implementation supports amount of rounds up to 65534