@@ -40,6 +40,51 @@ public BlockCipher get()
4040 }
4141 }
4242
43+ public static class ECB128
44+ extends BaseBlockCipher
45+ {
46+ public ECB128 ()
47+ {
48+ super (128 , new BlockCipherProvider ()
49+ {
50+ public BlockCipher get ()
51+ {
52+ return new SerpentEngine ();
53+ }
54+ });
55+ }
56+ }
57+
58+ public static class ECB192
59+ extends BaseBlockCipher
60+ {
61+ public ECB192 ()
62+ {
63+ super (192 , new BlockCipherProvider ()
64+ {
65+ public BlockCipher get ()
66+ {
67+ return new SerpentEngine ();
68+ }
69+ });
70+ }
71+ }
72+
73+ public static class ECB256
74+ extends BaseBlockCipher
75+ {
76+ public ECB256 ()
77+ {
78+ super (256 , new BlockCipherProvider ()
79+ {
80+ public BlockCipher get ()
81+ {
82+ return new SerpentEngine ();
83+ }
84+ });
85+ }
86+ }
87+
4388 public static class TECB
4489 extends BaseBlockCipher
4590 {
@@ -64,6 +109,33 @@ public CBC()
64109 }
65110 }
66111
112+ public static class CBC128
113+ extends BaseBlockCipher
114+ {
115+ public CBC128 ()
116+ {
117+ super (128 , new CBCBlockCipher (new SerpentEngine ()), 128 );
118+ }
119+ }
120+
121+ public static class CBC192
122+ extends BaseBlockCipher
123+ {
124+ public CBC192 ()
125+ {
126+ super (192 , new CBCBlockCipher (new SerpentEngine ()), 128 );
127+ }
128+ }
129+
130+ public static class CBC256
131+ extends BaseBlockCipher
132+ {
133+ public CBC256 ()
134+ {
135+ super (256 , new CBCBlockCipher (new SerpentEngine ()), 128 );
136+ }
137+ }
138+
67139 public static class CFB
68140 extends BaseBlockCipher
69141 {
@@ -73,6 +145,33 @@ public CFB()
73145 }
74146 }
75147
148+ public static class CFB128
149+ extends BaseBlockCipher
150+ {
151+ public CFB128 ()
152+ {
153+ super (128 , new BufferedBlockCipher (new CFBBlockCipher (new SerpentEngine (), 128 )), 128 );
154+ }
155+ }
156+
157+ public static class CFB192
158+ extends BaseBlockCipher
159+ {
160+ public CFB192 ()
161+ {
162+ super (192 , new BufferedBlockCipher (new CFBBlockCipher (new SerpentEngine (), 128 )), 128 );
163+ }
164+ }
165+
166+ public static class CFB256
167+ extends BaseBlockCipher
168+ {
169+ public CFB256 ()
170+ {
171+ super (256 , new BufferedBlockCipher (new CFBBlockCipher (new SerpentEngine (), 128 )), 128 );
172+ }
173+ }
174+
76175 public static class OFB
77176 extends BaseBlockCipher
78177 {
@@ -82,6 +181,33 @@ public OFB()
82181 }
83182 }
84183
184+ public static class OFB128
185+ extends BaseBlockCipher
186+ {
187+ public OFB128 ()
188+ {
189+ super (128 , new BufferedBlockCipher (new OFBBlockCipher (new SerpentEngine (), 128 )), 128 );
190+ }
191+ }
192+
193+ public static class OFB192
194+ extends BaseBlockCipher
195+ {
196+ public OFB192 ()
197+ {
198+ super (192 , new BufferedBlockCipher (new OFBBlockCipher (new SerpentEngine (), 128 )), 128 );
199+ }
200+ }
201+
202+ public static class OFB256
203+ extends BaseBlockCipher
204+ {
205+ public OFB256 ()
206+ {
207+ super (256 , new BufferedBlockCipher (new OFBBlockCipher (new SerpentEngine (), 128 )), 128 );
208+ }
209+ }
210+
85211 public static class KeyGen
86212 extends BaseKeyGenerator
87213 {
@@ -174,21 +300,21 @@ public void configure(ConfigurableProvider provider)
174300 provider .addAlgorithm ("KeyGenerator.Tnepres" , PREFIX + "$TKeyGen" );
175301 provider .addAlgorithm ("AlgorithmParameters.Tnepres" , PREFIX + "$TAlgParams" );
176302
177- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_128_ECB , PREFIX + "$ECB " );
178- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_192_ECB , PREFIX + "$ECB " );
179- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_256_ECB , PREFIX + "$ECB " );
303+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_128_ECB , PREFIX + "$ECB128 " );
304+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_192_ECB , PREFIX + "$ECB192 " );
305+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_256_ECB , PREFIX + "$ECB256 " );
180306
181- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_128_CBC , PREFIX + "$CBC " );
182- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_192_CBC , PREFIX + "$CBC " );
183- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_256_CBC , PREFIX + "$CBC " );
307+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_128_CBC , PREFIX + "$CBC128 " );
308+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_192_CBC , PREFIX + "$CBC192 " );
309+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_256_CBC , PREFIX + "$CBC256 " );
184310
185- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_128_CFB , PREFIX + "$CFB " );
186- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_192_CFB , PREFIX + "$CFB " );
187- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_256_CFB , PREFIX + "$CFB " );
311+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_128_CFB , PREFIX + "$CFB128 " );
312+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_192_CFB , PREFIX + "$CFB192 " );
313+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_256_CFB , PREFIX + "$CFB256 " );
188314
189- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_128_OFB , PREFIX + "$OFB " );
190- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_192_OFB , PREFIX + "$OFB " );
191- provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_256_OFB , PREFIX + "$OFB " );
315+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_128_OFB , PREFIX + "$OFB128 " );
316+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_192_OFB , PREFIX + "$OFB192 " );
317+ provider .addAlgorithm ("Cipher" , GNUObjectIdentifiers .Serpent_256_OFB , PREFIX + "$OFB256 " );
192318
193319 addGMacAlgorithm (provider , "SERPENT" , PREFIX + "$SerpentGMAC" , PREFIX + "$KeyGen" );
194320 addGMacAlgorithm (provider , "TNEPRES" , PREFIX + "$TSerpentGMAC" , PREFIX + "$TKeyGen" );
0 commit comments