Mercurial > projects > dcrypt
comparison dcrypt/crypto/BlockCipherPadding.d @ 0:0e08791a1418
Initial import.
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Sun, 10 Aug 2008 14:20:17 -0400 |
parents | |
children | cd376996cdb3 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:0e08791a1418 |
---|---|
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.BlockCipherPadding; | |
10 | |
11 public import dcrypt.crypto.errors.InvalidPaddingError; | |
12 | |
13 /** Base padding class for implementing block padding schemes. */ | |
14 abstract class BlockCipherPadding { | |
15 /** Returns: The name of the padding scheme implemented. */ | |
16 char[] name(); | |
17 | |
18 /** | |
19 * Pad the (last) block of plaintext to block length. | |
20 * | |
21 * Params: | |
22 * input_ = Plaintext block to be padded. | |
23 * inOffset = Offset at which to begin padding input_. | |
24 * | |
25 * Returns: The number of padding bytes added. | |
26 */ | |
27 uint padBlock(void[] input_, uint inOff); | |
28 | |
29 /** | |
30 * Return the number of pad bytes in the block. | |
31 * | |
32 * Params: | |
33 * input_ = Padded block of which to count the pad bytes. | |
34 * | |
35 * Returns: The number of pad bytes in the block. | |
36 * | |
37 * Throws: dcrypt.crypto.errors.InvalidPaddingError if | |
38 * pad length cannot be discerned. | |
39 */ | |
40 uint padLength(void[] input_); | |
41 } |