Mercurial > projects > dcrypt
comparison dcrypt/crypto/ManagedBlockCipher.d @ 28:ad687db713a4
Further reworked the code for hash padding. Replaced all instances of 'char[]' with 'string' and removed a few 'const' modifiers as per Glenn Haecker's patch for D2 compatibility. Updated CONTRIBUTORS file.
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Sun, 10 May 2009 22:38:48 -0400 |
parents | 8b5eaf3c2979 |
children |
comparison
equal
deleted
inserted
replaced
27:8b5eaf3c2979 | 28:ad687db713a4 |
---|---|
41 */ | 41 */ |
42 this(BlockCipher cipher, BlockCipherPadding padding=null) | 42 this(BlockCipher cipher, BlockCipherPadding padding=null) |
43 { | 43 { |
44 this.cipher = cipher; | 44 this.cipher = cipher; |
45 | 45 |
46 char[] mode = cipher.name; | 46 string mode = cipher.name; |
47 int i; | 47 int i; |
48 for (i = 0; i < mode.length; i++) | 48 for (i = 0; i < mode.length; i++) |
49 if (mode[i] == '/') | 49 if (mode[i] == '/') |
50 break; | 50 break; |
51 | 51 |
63 { | 63 { |
64 this.encrypt = encrypt; | 64 this.encrypt = encrypt; |
65 cipher.init(encrypt, params); | 65 cipher.init(encrypt, params); |
66 } | 66 } |
67 | 67 |
68 char[] name() | 68 string name() |
69 { | 69 { |
70 if (padding is null) | 70 if (padding is null) |
71 return cipher.name; | 71 return cipher.name; |
72 | 72 |
73 return cipher.name~"/"~padding.name; | 73 return cipher.name~"/"~padding.name; |