Mercurial > projects > dcrypt
comparison dcrypt/crypto/BlockCipherPadding.d @ 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.
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Wed, 20 Aug 2008 20:08:07 -0400 |
parents | 0e08791a1418 |
children | 8b5eaf3c2979 |
comparison
equal
deleted
inserted
replaced
9:29b910949588 | 10:cd376996cdb3 |
---|---|
14 abstract class BlockCipherPadding { | 14 abstract class BlockCipherPadding { |
15 /** Returns: The name of the padding scheme implemented. */ | 15 /** Returns: The name of the padding scheme implemented. */ |
16 char[] name(); | 16 char[] name(); |
17 | 17 |
18 /** | 18 /** |
19 * Pad the (last) block of plaintext to block length. | 19 * Generate padding to a specific length. |
20 * | 20 * |
21 * Params: | 21 * Params: |
22 * input_ = Plaintext block to be padded. | 22 * len = Length of padding to generate |
23 * inOffset = Offset at which to begin padding input_. | |
24 * | 23 * |
25 * Returns: The number of padding bytes added. | 24 * Returns: The padding bytes to be added. |
26 */ | 25 */ |
27 uint padBlock(void[] input_, uint inOff); | 26 ubyte[] pad(uint len); |
28 | 27 |
29 /** | 28 /** |
30 * Return the number of pad bytes in the block. | 29 * Return the number of pad bytes in the block. |
31 * | 30 * |
32 * Params: | 31 * Params: |
35 * Returns: The number of pad bytes in the block. | 34 * Returns: The number of pad bytes in the block. |
36 * | 35 * |
37 * Throws: dcrypt.crypto.errors.InvalidPaddingError if | 36 * Throws: dcrypt.crypto.errors.InvalidPaddingError if |
38 * pad length cannot be discerned. | 37 * pad length cannot be discerned. |
39 */ | 38 */ |
40 uint padLength(void[] input_); | 39 uint unpad(void[] input_); |
41 } | 40 } |