Mercurial > projects > dcrypt
annotate dcrypt/crypto/StreamCipher.d @ 27:8b5eaf3c2979
Fixed error in hash message padding reported by Glenn Haecker.
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Sat, 09 May 2009 23:29:20 -0400 |
parents | cd376996cdb3 |
children |
rev | line source |
---|---|
0 | 1 /** |
2 * This file is part of the dcrypt project. | |
3 * | |
4 * Copyright: Copyright (C) dcrypt contributors 2008. All rights reserved. | |
5 * License: MIT | |
6 * Authors: Thomas Dixon | |
7 */ | |
8 | |
9 module dcrypt.crypto.StreamCipher; | |
10 | |
10
cd376996cdb3
Renamed SymmetricCipher back to Cipher (we don't support any other kind atm, I'll deal with it when we do.). Added BlockCipherWrapper for the encryption of arbitrary streams with or without padding. Removed hashByName, and replaced it with createHash. Re-did the high-level API, and filled out Crypto. Added cipher creation via createCipher. Added dsk to the CONTRIBUTORS file for helping with the design of the high-level API.
Thomas Dixon <reikon@reikon.us>
parents:
8
diff
changeset
|
11 public import dcrypt.crypto.Cipher; |
0 | 12 public import dcrypt.crypto.params.CipherParameters; |
13 public import dcrypt.crypto.params.SymmetricKey; | |
14 | |
15 /** Interface for a standard stream cipher. */ | |
27
8b5eaf3c2979
Fixed error in hash message padding reported by Glenn Haecker.
Thomas Dixon <reikon@reikon.us>
parents:
10
diff
changeset
|
16 abstract class StreamCipher : Cipher |
8b5eaf3c2979
Fixed error in hash message padding reported by Glenn Haecker.
Thomas Dixon <reikon@reikon.us>
parents:
10
diff
changeset
|
17 { |
0 | 18 /** |
19 * Process one byte of input. | |
20 * | |
21 * Params: | |
22 * input = Byte to XOR with keystream. | |
23 * | |
24 * Returns: One byte of input XORed with the keystream. | |
25 */ | |
8
23c62e28b3a4
Reworked symmetric cipher classes to have SymmetricCipher as their superclass, and follow the general interface of init(), process(), etc. Made sure everything still passed test vectors. Removed Cipher class. I'll worry about that shit when we support something other than symmetric ciphers.
Thomas Dixon <reikon@reikon.us>
parents:
0
diff
changeset
|
26 ubyte returnByte(ubyte input); |
0 | 27 } |