comparison dcrypt/crypto/Crypto.d @ 11:02970e63257d

Fix stupid error with using uint instead of int in create*
author Thomas Dixon <reikon@reikon.us>
date Wed, 20 Aug 2008 23:33:02 -0400
parents cd376996cdb3
children 8c7f8fecdd75
comparison
equal deleted inserted replaced
10:cd376996cdb3 11:02970e63257d
15 import dcrypt.crypto.hashes.SHA224; 15 import dcrypt.crypto.hashes.SHA224;
16 import dcrypt.crypto.hashes.SHA256; 16 import dcrypt.crypto.hashes.SHA256;
17 import dcrypt.crypto.hashes.SHA384; 17 import dcrypt.crypto.hashes.SHA384;
18 import dcrypt.crypto.hashes.SHA512; 18 import dcrypt.crypto.hashes.SHA512;
19 19
20 // Message authentication codes
21 public import dcrypt.crypto.MAC;
22 public import dcrypt.crypto.macs.HMAC;
23
20 // Params 24 // Params
21 public import dcrypt.crypto.params.SymmetricKey; 25 public import dcrypt.crypto.params.SymmetricKey;
22 public import dcrypt.crypto.params.ParametersWithIV; 26 public import dcrypt.crypto.params.ParametersWithIV;
23
24 27
25 // Ciphers 28 // Ciphers
26 public import dcrypt.crypto.Cipher; 29 public import dcrypt.crypto.Cipher;
27 public import dcrypt.crypto.BlockCipher; 30 public import dcrypt.crypto.BlockCipher;
28 public import dcrypt.crypto.StreamCipher; 31 public import dcrypt.crypto.StreamCipher;
29 public import dcrypt.crypto.BlockCipherWrapper; 32 public import dcrypt.crypto.BlockCipherWrapper;
30 import dcrypt.crypto.ciphers.Blowfish; 33 import dcrypt.crypto.ciphers.Blowfish;
31 import dcrypt.crypto.ciphers.RC6; 34 import dcrypt.crypto.ciphers.RC6;
32 import dcrypt.crypto.ciphers.TEA; 35 import dcrypt.crypto.ciphers.TEA;
33 import dcrypt.crypto.ciphers.XTEA; 36 import dcrypt.crypto.ciphers.XTEA;
37 import dcrypt.crypto.ciphers.AES;
34 import dcrypt.crypto.ciphers.RC4; 38 import dcrypt.crypto.ciphers.RC4;
35 import dcrypt.crypto.ciphers.AES;
36 39
37 // Block modes 40 // Block modes
38 import dcrypt.crypto.modes.CBC; 41 import dcrypt.crypto.modes.CBC;
39 import dcrypt.crypto.modes.CTR; 42 import dcrypt.crypto.modes.CTR;
40 43
98 default: 101 default:
99 throw new InvalidParameterError("Unknown hash function passed to createHash()"); 102 throw new InvalidParameterError("Unknown hash function passed to createHash()");
100 } 103 }
101 } 104 }
102 105
103 static Cipher createCipher(uint cipher, uint mode=Modes.ECB, uint padding=Padding.None) { 106 static Cipher createCipher(uint cipher, int mode=Modes.ECB, int padding=Padding.None) {
104 BlockCipher c = null, 107 BlockCipher c = null,
105 m = null; 108 m = null;
106 BlockCipherPadding p = null; 109 BlockCipherPadding p = null;
107 switch (cipher) { 110 switch (cipher) {
108 case Ciphers.Blowfish: 111 case Ciphers.Blowfish: