-
Notifications
You must be signed in to change notification settings - Fork 14
/
AES_Cryptography.ttl
executable file
·244 lines (193 loc) · 5.97 KB
/
AES_Cryptography.ttl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
; Tera Term Setting:
; 1. Before running Tera Term Macro script, you should set language as English
; and transmit delay in Serial port setup to 5msec/char and 5msec/line.
; 2. By default, Tera Term log will be stored in Tera Term installation Directory.
changedir '.'
logopen "AES_Cryptography.log" 0 0 0 1
settitle 'PolarFire User Crypto AES-128'
setsync 1
;Clear screen
clearscreen 0
; Set baud rate to 115200
setbaud 115200
; local echo off
setecho 0
;; Send Dummy
send $0
; ---------------------------------------------------------------------------------------------------------------
; AES-128 Encryption
; ---------------------------------------------------------------------------------------------------------------
;Test Case 1 - using DMA
; INPUT
; KEY = c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558
; PLAINTEXT = 00000000000000000000000000000000
; OUTPUT
; CIPHERTEXT = 46f2fb342d6f0ab477476fc501242c5f
; ---------------------------------------------------------------------------------------------------------------
send '1'
pause 1
;key
send 'c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558'
pause 1
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1
;PLAINTEXT
send '00000000000000000000000000000000'
send 13
pause 1
;DMA enabled
send '1'
pause 4
;Press any key
send $0
; ---------------------------------------------------------------------------------------------------------------
;Test Case 2 - non DMA
; INPUT
; KEY = c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558
; PLAINTEXT = 00000000000000000000000000000000
; OUTPUT
; CIPHERTEXT = 46f2fb342d6f0ab477476fc501242c5f
; ---------------------------------------------------------------------------------------------------------------
send '1'
pause 1
;key
send 'c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558'
pause 1
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1
;PLAINTEXT
send '00000000000000000000000000000000'
send 13
pause 1
;DMA disabled
send '0'
pause 4
;Press any key
send $0
; ---------------------------------------------------------------------------------------------------------------
; Test Case 3 - DMA enabled
; INPUT
; KEY = 0000000000000000000000000000000000000000000000000000000000000000
; PLAINTEXT = 91fbef2d15a97816060bee1feaa49afe
; OUTPUT
; CIPHERTEXT = 1bc704f1bce135ceb810341b216d7abe
; ---------------------------------------------------------------------------------------------------------------
send '1'
pause 1
;key
send '0000000000000000000000000000000000000000000000000000000000000000'
pause 1
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1
;PLAINTEXT
send '91fbef2d15a97816060bee1feaa49afe'
send 13
pause 1
;DMA Enabled
send '1'
pause 4
;Press any key
send $0
; ---------------------------------------------------------------------------------------------------------------
; Test Case 4 - DMA disabled
; INPUT
; KEY = 0000000000000000000000000000000000000000000000000000000000000000
; PLAINTEXT = 91fbef2d15a97816060bee1feaa49afe
; OUTPUT
; CIPHERTEXT = 1bc704f1bce135ceb810341b216d7abe
; ---------------------------------------------------------------------------------------------------------------
send '1'
pause 1
;key
send '0000000000000000000000000000000000000000000000000000000000000000'
pause 1
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1
;PLAINTEXT
send '91fbef2d15a97816060bee1feaa49afe'
send 13
pause 1
;DMA Disabled
send '0'
pause 4
;Press any key
send $0
; ---------------------------------------------------------------------------------------------------------------
; Test Case 5 - DMA Enabled
; INPUT
; KEY = 1d85a181b54cde51f0e098095b2962fdc93b51fe9b88602b3f54130bf76a5bd9
; PLAINTEXT = 00000000000000000000000000000000
; OUTPUT
; CIPHERTEXT = 531c2c38344578b84d50b3c917bbb6e1
; ---------------------------------------------------------------------------------------------------------------
send '1'
pause 1
;key
send '1d85a181b54cde51f0e098095b2962fdc93b51fe9b88602b3f54130bf76a5bd9'
pause 1
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1
;PLAINTEXT
send '00000000000000000000000000000000'
send 13
pause 1
;DMA Enabled
send '1'
pause 4
;Press any key
send $0
; ---------------------------------------------------------------------------------------------------------------
; AES-128 Decryption
; ---------------------------------------------------------------------------------------------------------------
; ---------------------------------------------------------------------------------------------------------------
; Test Case 6 - non DMA
; INPUT
; KEY = 28d46cffa158533194214a91e712fc2b45b518076675affd910edeca5f41ac64
; CIPHERTEXT = 4bf3b0a69aeb6657794f2901b1440ad4
; OUTPUT
; PLAINTEXT = 00000000000000000000000000000000
; ---------------------------------------------------------------------------------------------------------------
send '2'
pause 1
;key
send '28d46cffa158533194214a91e712fc2b45b518076675affd910edeca5f41ac64'
pause 1
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1
;CIPHERTEXT
send '4bf3b0a69aeb6657794f2901b1440ad4'
pause 1
;DMA disabed
send '0'
pause 4
;Press any key
send $0
; ---------------------------------------------------------------------------------------------------------------
; Test Case 7 - DMA
; INPUT
; KEY = 28d46cffa158533194214a91e712fc2b45b518076675affd910edeca5f41ac64
; CIPHERTEXT = 4bf3b0a69aeb6657794f2901b1440ad4
; OUTPUT
; PLAINTEXT = 00000000000000000000000000000000
; ---------------------------------------------------------------------------------------------------------------
send '2'
pause 1
;key
send '28d46cffa158533194214a91e712fc2b45b518076675affd910edeca5f41ac64'
pause 1
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1
;CIPHERTEXT
send '4bf3b0a69aeb6657794f2901b1440ad4'
pause 1
;DMA enabed
send '1'
pause 5
logclose