1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package io.github.tonywasher.joceanus.gordianknot.api.cipher.spec;
19
20 import io.github.tonywasher.joceanus.gordianknot.api.base.GordianLength;
21
22
23
24
25 public interface GordianSymKeySpecBuilder {
26
27
28
29
30
31
32 GordianSymKeySpecBuilder withType(GordianSymKeyType pType);
33
34
35
36
37
38
39
40 GordianSymKeySpecBuilder withBlockLength(GordianLength pBlockLength);
41
42
43
44
45
46
47
48 GordianSymKeySpecBuilder withKeyLength(GordianLength pKeyLength);
49
50
51
52
53
54
55 GordianSymKeySpec build();
56
57
58
59
60
61
62
63
64 default GordianSymKeySpec symKey(final GordianSymKeyType pKeyType,
65 final GordianLength pKeyLength) {
66 return withType(pKeyType).withKeyLength(pKeyLength).build();
67 }
68
69
70
71
72
73
74
75
76
77 default GordianSymKeySpec symKey(final GordianSymKeyType pKeyType,
78 final GordianLength pBlockLength,
79 final GordianLength pKeyLength) {
80 return withType(pKeyType).withBlockLength(pBlockLength).withKeyLength(pKeyLength).build();
81 }
82
83
84
85
86
87
88
89 default GordianSymKeySpec aes(final GordianLength pKeyLength) {
90 return withType(GordianSymKeyType.AES).withKeyLength(pKeyLength).build();
91 }
92
93
94
95
96
97
98
99 default GordianSymKeySpec serpent(final GordianLength pKeyLength) {
100 return withType(GordianSymKeyType.SERPENT).withKeyLength(pKeyLength).build();
101 }
102
103
104
105
106
107
108
109 default GordianSymKeySpec twoFish(final GordianLength pKeyLength) {
110 return withType(GordianSymKeyType.TWOFISH).withKeyLength(pKeyLength).build();
111 }
112
113
114
115
116
117
118
119 default GordianSymKeySpec threeFish(final GordianLength pKeyLength) {
120 return withType(GordianSymKeyType.THREEFISH).withKeyLength(pKeyLength).build();
121 }
122
123
124
125
126
127
128
129 default GordianSymKeySpec camellia(final GordianLength pKeyLength) {
130 return withType(GordianSymKeyType.CAMELLIA).withKeyLength(pKeyLength).build();
131 }
132
133
134
135
136
137
138
139 default GordianSymKeySpec rc2(final GordianLength pKeyLength) {
140 return withType(GordianSymKeyType.RC2).withKeyLength(pKeyLength).build();
141 }
142
143
144
145
146
147
148 default GordianSymKeySpec rc5() {
149 return withType(GordianSymKeyType.RC5).build();
150 }
151
152
153
154
155
156
157
158 default GordianSymKeySpec rc5(final GordianLength pBlockLength) {
159 return withType(GordianSymKeyType.RC5).withBlockLength(pBlockLength).build();
160 }
161
162
163
164
165
166
167
168 default GordianSymKeySpec rc6(final GordianLength pKeyLength) {
169 return withType(GordianSymKeyType.RC6).withKeyLength(pKeyLength).build();
170 }
171
172
173
174
175
176
177 default GordianSymKeySpec cast5() {
178 return withType(GordianSymKeyType.CAST5).build();
179 }
180
181
182
183
184
185
186
187 default GordianSymKeySpec cast6(final GordianLength pKeyLength) {
188 return withType(GordianSymKeyType.CAST6).withKeyLength(pKeyLength).build();
189 }
190
191
192
193
194
195
196
197 default GordianSymKeySpec aria(final GordianLength pKeyLength) {
198 return withType(GordianSymKeyType.ARIA).withKeyLength(pKeyLength).build();
199 }
200
201
202
203
204
205
206 default GordianSymKeySpec sm4() {
207 return withType(GordianSymKeyType.SM4).build();
208 }
209
210
211
212
213
214
215 default GordianSymKeySpec noekeon() {
216 return withType(GordianSymKeyType.NOEKEON).build();
217 }
218
219
220
221
222
223
224 default GordianSymKeySpec seed() {
225 return withType(GordianSymKeyType.SEED).build();
226 }
227
228
229
230
231
232
233 default GordianSymKeySpec tea() {
234 return withType(GordianSymKeyType.TEA).build();
235 }
236
237
238
239
240
241
242 default GordianSymKeySpec xtea() {
243 return withType(GordianSymKeyType.XTEA).build();
244 }
245
246
247
248
249
250
251 default GordianSymKeySpec idea() {
252 return withType(GordianSymKeyType.IDEA).build();
253 }
254
255
256
257
258
259
260 default GordianSymKeySpec skipjack() {
261 return withType(GordianSymKeyType.SKIPJACK).build();
262 }
263
264
265
266
267
268
269
270 default GordianSymKeySpec desede(final GordianLength pKeyLength) {
271 return withType(GordianSymKeyType.DESEDE).build();
272 }
273
274
275
276
277
278
279
280 default GordianSymKeySpec blowfish(final GordianLength pKeyLength) {
281 return withType(GordianSymKeyType.BLOWFISH).build();
282 }
283
284
285
286
287
288
289
290 default GordianSymKeySpec kalyna(final GordianLength pKeyLength) {
291 return withType(GordianSymKeyType.KALYNA).withKeyLength(pKeyLength).build();
292 }
293
294
295
296
297
298
299
300
301 default GordianSymKeySpec kalyna(final GordianLength pBlockLength,
302 final GordianLength pKeyLength) {
303 return withType(GordianSymKeyType.KALYNA).withBlockLength(pBlockLength).withKeyLength(pKeyLength).build();
304 }
305
306
307
308
309
310
311 default GordianSymKeySpec gost() {
312 return withType(GordianSymKeyType.GOST).build();
313 }
314
315
316
317
318
319
320 default GordianSymKeySpec kuznyechik() {
321 return withType(GordianSymKeyType.KUZNYECHIK).build();
322 }
323
324
325
326
327
328
329
330 default GordianSymKeySpec shacal2(final GordianLength pKeyLength) {
331 return withType(GordianSymKeyType.SHACAL2).withKeyLength(pKeyLength).build();
332 }
333
334
335
336
337
338
339
340 default GordianSymKeySpec speck(final GordianLength pKeyLength) {
341 return withType(GordianSymKeyType.SPECK).withKeyLength(pKeyLength).build();
342 }
343
344
345
346
347
348
349
350 default GordianSymKeySpec simon(final GordianLength pKeyLength) {
351 return withType(GordianSymKeyType.SIMON).withKeyLength(pKeyLength).build();
352 }
353
354
355
356
357
358
359
360 default GordianSymKeySpec mars(final GordianLength pKeyLength) {
361 return withType(GordianSymKeyType.MARS).withKeyLength(pKeyLength).build();
362 }
363
364
365
366
367
368
369
370 default GordianSymKeySpec anubis(final GordianLength pKeyLength) {
371 return withType(GordianSymKeyType.ANUBIS).withKeyLength(pKeyLength).build();
372 }
373
374
375
376
377
378
379
380 default GordianSymKeySpec lea(final GordianLength pKeyLength) {
381 return withType(GordianSymKeyType.LEA).withKeyLength(pKeyLength).build();
382 }
383 }