3
$\begingroup$

I'm looking for Test Vectors to test my implementation of PRESENT. I would like to test a different input from the usual where the key and the plaintext are either 000..000 or FFF...FFF.

$\endgroup$
1

3 Answers 3

3
$\begingroup$

There are many sources presenting the test vectors.

But you can also extract it from sourcecode implementations as opencores.org et al offer them…

 Plaintext: 0000000000000000

 Key: 00000000000000000000 (80-bit)

 Round key 1: 0000000000000000
 Round key 2: c000000000000000
 Round key 3: 5000180000000001
 Round key 4: 60000a0003000001
 Round key 5: b0000c0001400062
 Round key 6: 900016000180002a
 Round key 7: 0001920002c00033
 Round key 8: a000a0003240005b
 Round key 9: d000d4001400064c
 Round key 10: 30017a001a800284
 Round key 11: e01926002f400355
 Round key 12: f00a1c0324c005ed
 Round key 13: 800d5e014380649e
 Round key 14: 4017b001abc02876
 Round key 15: 71926802f600357f
 Round key 16: 10a1ce324d005ec7
 Round key 17: 20d5e21439c649a8
 Round key 18: c17b041abc428730
 Round key 19: c926b82f60835781
 Round key 20: 6a1cd924d705ec19
 Round key 21: bd5e0d439b249aea
 Round key 22: 07b077abc1a8736e
 Round key 23: 426ba0f60ef5783e
 Round key 24: 41cda84d741ec1d5
 Round key 25: f5e0e839b509ae8f
 Round key 26: 2b075ebc1d0736ad
 Round key 27: 86ba2560ebd783ad
 Round key 28: 8cdab0d744ac1d77
 Round key 29: 1e0eb19b561ae89b
 Round key 30: d075c3c1d6336acd
 Round key 31: 8ba27a0eb8783ac9
 Round key 32: 6dab31744f41d700
 
 Round Output 1: ffffffff00000000
 Round Output 2: 80ff00ffff008000
 Round Output 3: 4036c837b7c88c09
 Round Output 4: 73c2cd26b6192359
 Round Output 5: 41d7be58531e4446
 Round Output 6: 182ef861ad62fd1c
 Round Output 7: 0ea0a5b67effc5a4
 Round Output 8: bba0b848a113e080
 Round Output 9: fa943423a9142338
 Round Output 10: 69f2e22d63684d54
 Round Output 11: 548a4b63c330a59d
 Round Output 12: d75f955fa228e4ca
 Round Output 13: 44255864103841f9
 Round Output 14: e2cc9004363f6c12
 Round Output 15: c36682c5cd375421
 Round Output 16: 597db55cc2a5d9b6
 Round Output 17: e67ce40e71b8b713
 Round Output 18: 751df6d6807b5b59
 Round Output 19: b948414e23332c93
 Round Output 20: 5b75890dcfb3d563
 Round Output 21: 5679203168278f5a
 Round Output 22: 17c377c413fa45a3
 Round Output 23: 262a2de73b5f3ecd
 Round Output 24: d3a053128b4d7bb3
 Round Output 25: 7db29209c28a20fa
 Round Output 26: 62050c9940f400b9
 Round Output 27: 65d50da21fbcc09f
 Round Output 28: 6a50663c540d862f
 Round Output 29: c79b8ff00a48df35
 Round Output 30: 4a38c5e00283fba1
 Round Output 31: 38d2f04c34635345
 
 Ciphertext: 5579c1387b228445
$\endgroup$
1
  • 1
    $\begingroup$ Aren't those round keys of 80 bits? $\endgroup$
    – hola
    Aug 23, 2016 at 6:41
2
$\begingroup$

In the original paper (pp. 16) one can find the requested test-vectors.
The paper includes test vectors for all four cases you request (one or both of key and plaintext are $00...00$ or $FF...FF$).
The following table shows the test vectors:

Plaintext         | Key                    | Ciphertext
------------------|------------------------|-----------------
00000000 00000000 | 00000000 00000000 0000 | 5579C138 7B228445
00000000 00000000 | FFFFFFFF FFFFFFFF FFFF | E72C46C0 F5945049
FFFFFFFF FFFFFFFF | 00000000 00000000 0000 | A112FFC7 2F68417B
FFFFFFFF FFFFFFFF | FFFFFFFF FFFFFFFF FFFF | 3333DCD3 213210D2
$\endgroup$
1
  • 5
    $\begingroup$ While the phrasing in the question may be a bit ambiguous, the way I interpret it is that the OP would like some other test vectors than these "usual" ones, for further testing. $\endgroup$ Dec 14, 2015 at 15:25
1
$\begingroup$
Plaintext Key Ciphertext
00000000 00000000 00000000 00000000 0000 5579C138 7B228445
00000000 00000000 FFFFFFFF FFFFFFFF FFFF E72C46C0 F5945049
FFFFFFFF FFFFFFFF 00000000 00000000 0000 A112FFC7 2F68417B
FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFF 3333DCD3 213210D2

I was not able to get the round keys that are mentioned above. I got the below round keys and in the end, got the expected result.

For the first test case the round keys (PRESENT-80) are as follows:

Round Key 1:C0000000000000008000
Round Key 2:50001800000000010000
Round Key 3:60000A00030000018000
Round Key 4:B0000C00014000620000
Round Key 5:900016000180002A800C
Round Key 6:0001920002C000330005
Round Key 7:A000A0003240005B8006
Round Key 8:D000D4001400064C000B
Round Key 9:30017A001A80028480C9
Round Key 10:E01926002F4003550050
Round Key 11:F00A1C0324C005ED806A
Round Key 12:800D5E014380649E00BD
Round Key 13:4017B001ABC028768C93
Round Key 14:71926802F600357F050E
Round Key 15:10A1CE324D005EC786AF
Round Key 16:20D5E21439C649A80BD8
Round Key 17:C17B041ABC4287304935
Round Key 18:C926B82F6083578150E6
Round Key 19:6A1CD924D705EC19EAF0
Round Key 20:BD5E0D439B249AEABD83
Round Key 21:07B077ABC1A8736E135D
Round Key 22:426BA0F60EF5783E0E6D
Round Key 23:41CDA84D741EC1D52F07
Round Key 24:F5E0E839B509AE8FD83A
Round Key 25:2B075EBC1D0736ADB5D1
Round Key 26:86BA2560EBD783ADE6D5
Round Key 27:8CDAB0D744AC1D777075
Round Key 28:1E0EB19B561AE89B83AE
Round Key 29:D075C3C1D6336ACDDD13
Round Key 30:8BA27A0EB8783AC96D59
Round Key 31:6DAB31744F41D7008759

Output: 5579C1387B228445
$\endgroup$
2
  • $\begingroup$ Those do appear to be the same round keys but without the 0th round key which is direct use of the input key. I think that your implementations are in agreement. $\endgroup$
    – Daniel S
    Mar 12, 2021 at 22:31
  • 1
    $\begingroup$ Ya, my bad. Just noticed that they're all missing last 4 bytes of the key. Otherwise they're the same. Just pasted this for debugging purposes. $\endgroup$
    – RandyJ149
    Mar 13, 2021 at 23:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.