summary refs log tree commit diff
path: root/Crypto/src/crypto/parameters/RC2Parameters.cs
blob: 7a6d5bb6ecc9b5fd67447f6ea6744c94e34c8fa7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;

namespace Org.BouncyCastle.Crypto.Parameters
{
	public class RC2Parameters
		: KeyParameter
	{
		private readonly int bits;

		public RC2Parameters(
			byte[] key)
			: this(key, (key.Length > 128) ? 1024 : (key.Length * 8))
		{
		}

		public RC2Parameters(
			byte[]	key,
			int		keyOff,
			int		keyLen)
			: this(key, keyOff, keyLen, (keyLen > 128) ? 1024 : (keyLen * 8))
		{
		}

		public RC2Parameters(
			byte[]	key,
			int		bits)
			: base(key)
		{
			this.bits = bits;
		}

		public RC2Parameters(
			byte[]	key,
			int		keyOff,
			int		keyLen,
			int		bits)
			: base(key, keyOff, keyLen)
		{
			this.bits = bits;
		}

		public int EffectiveKeyBits
		{
			get { return bits; }
		}
	}
}