Changes between Initial Version and Version 1 of Ticket #27573, comment 9


Ignore:
Timestamp:
06/17/19 13:58:50 (6 months ago)
Author:
asante
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27573, comment 9

    initial v1  
    1 actually I realised that I would like to have some design changes. I'll add them in a minute
     1Actually I realised that I would like to have some design changes.
     2
     3In principle, so that this is easier to do experiments with, it should be easy to modify the cipher. I have something in mind like the following:
     4
     5{{{
     6sage: cipher = PRESENT(rounds=1, doLastLinearLayer=False)
     7sage: cipher.sbox = SBox(range(16))
     8sage: cipher.key_schedule = lambda x: [0, 0]  # return the 0 keys as round keys
     9sage: cipher.encrypt(plain=0x1234, key=0x0) == 0x1234
     10True
     11}}}
     12
     13So this would require the implementation to split the encrypt function into a `round` function that uses an `sboxlayer` function and a `linearlayer` function, the `sboxlayer` uses the member variable `sbox`. All these should not be internal functions, but visible and documented, so that the user knows about them and that it is possible to modify them.
     14
     15I hope this is clear, otherwise I can specify this further.