annotate dcrypt/crypto/BlockCipherPadding.d @ 35:6b2c35b84186 0.1

Removed a D2 version statement from the BlockCipherPadding class. Minor consistency correction to the PKCS7 class. Glenn Haecker reports dcrypt now compiles successfully with D2.
author Thomas Dixon <reikon@reikon.us>
date Thu, 14 May 2009 17:46:11 -0400
parents 2b4bccdc8387
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
1 /**
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
2 * This file is part of the dcrypt project.
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
3 *
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
4 * Copyright: Copyright (C) dcrypt contributors 2008. All rights reserved.
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
5 * License: MIT
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
6 * Authors: Thomas Dixon
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
7 */
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
8
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
9 module dcrypt.crypto.BlockCipherPadding;
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
10
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
11 public import dcrypt.crypto.errors.InvalidPaddingError;
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
12
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
13 /** Base padding class for implementing block padding schemes. */
27
8b5eaf3c2979 Fixed error in hash message padding reported by Glenn Haecker.
Thomas Dixon <reikon@reikon.us>
parents: 10
diff changeset
14 abstract class BlockCipherPadding
8b5eaf3c2979 Fixed error in hash message padding reported by Glenn Haecker.
Thomas Dixon <reikon@reikon.us>
parents: 10
diff changeset
15 {
32
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
16 /** Returns: The name of the padding scheme implemented. */
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
17 string name();
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
18
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
19 /**
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
20 * Generate padding to a specific length.
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
21 *
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
22 * Params:
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
23 * len = Length of padding to generate
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
24 *
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
25 * Returns: The padding bytes to be added.
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
26 */
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
27 ubyte[] pad(uint len);
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
28
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
29 /**
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
30 * Return the number of pad bytes in the block.
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
31 *
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
32 * Params:
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
33 * input_ = Padded block of which to count the pad bytes.
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
34 *
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
35 * Returns: The number of pad bytes in the block.
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
36 *
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
37 * Throws: dcrypt.crypto.errors.InvalidPaddingError if
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
38 * pad length cannot be discerned.
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
39 */
2b4bccdc8387 Added version() statements to play nice with D2's current feelings about const. Changed a few methods (addEntropy and read in the base PRNG class, and the constructor for ParametersWithIV) to accept void[] in place of ubyte[].
Thomas Dixon <reikon@reikon.us>
parents: 28
diff changeset
40 uint unpad(void[] input_);
35
6b2c35b84186 Removed a D2 version statement from the BlockCipherPadding class. Minor consistency correction to the PKCS7 class. Glenn Haecker reports dcrypt now compiles successfully with D2.
Thomas Dixon <reikon@reikon.us>
parents: 32
diff changeset
41
0
0e08791a1418 Initial import.
Thomas Dixon <reikon@reikon.us>
parents:
diff changeset
42 }