Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
RC2.cs
Go to the documentation of this file.
5
7
8[EditorBrowsable(EditorBrowsableState.Never)]
9[UnsupportedOSPlatform("browser")]
10public abstract class RC2 : SymmetricAlgorithm
11{
12 protected int EffectiveKeySizeValue;
13
14 private static readonly KeySizes[] s_legalBlockSizes = new KeySizes[1]
15 {
16 new KeySizes(64, 64, 0)
17 };
18
19 private static readonly KeySizes[] s_legalKeySizes = new KeySizes[1]
20 {
21 new KeySizes(40, 1024, 8)
22 };
23
24 public override int KeySize
25 {
26 get
27 {
28 return KeySizeValue;
29 }
30 set
31 {
33 {
35 }
36 base.KeySize = value;
37 }
38 }
39
40 public virtual int EffectiveKeySize
41 {
42 get
43 {
44 if (EffectiveKeySizeValue == 0)
45 {
46 return KeySizeValue;
47 }
49 }
50 set
51 {
52 if (value > KeySizeValue)
53 {
55 }
56 if (value == 0)
57 {
59 return;
60 }
61 if (value < 40)
62 {
64 }
65 if (value.IsLegalSize(s_legalKeySizes))
66 {
68 return;
69 }
71 }
72 }
73
74 protected RC2()
75 {
76 LegalBlockSizesValue = s_legalBlockSizes.CloneKeySizesArray();
77 LegalKeySizesValue = s_legalKeySizes.CloneKeySizesArray();
78 KeySizeValue = 128;
79 BlockSizeValue = 64;
81 }
82
83 [UnsupportedOSPlatform("android")]
84 public new static RC2 Create()
85 {
86 return new RC2Implementation();
87 }
88
89 [RequiresUnreferencedCode("The default algorithm implementations might be removed, use strong type references like 'RSA.Create()' instead.")]
90 public new static RC2? Create(string AlgName)
91 {
92 return (RC2)CryptoConfig.CreateFromName(AlgName);
93 }
94}
static string Cryptography_RC2_EKSKS
Definition SR.cs:132
static string Cryptography_InvalidKeySize
Definition SR.cs:92
static string Cryptography_RC2_EKS40
Definition SR.cs:130
Definition SR.cs:7
static ? object CreateFromName(string name, params object?[]? args)
static new RC2 Create()
Definition RC2.cs:84
static readonly KeySizes[] s_legalBlockSizes
Definition RC2.cs:14
virtual int EffectiveKeySize
Definition RC2.cs:41
static readonly KeySizes[] s_legalKeySizes
Definition RC2.cs:19
static new? RC2 Create(string AlgName)
Definition RC2.cs:90