Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ PadPkcs1Encryption() [2/2]

static void System.Security.Cryptography.RsaPaddingProcessor.PadPkcs1Encryption ( ReadOnlySpan< byte > source,
Span< byte > destination )
inlinestaticpackage

Definition at line 98 of file RsaPaddingProcessor.cs.

99 {
100 int length = source.Length;
101 int length2 = destination.Length;
102 if (length > length2 - 11)
103 {
104 throw new CryptographicException(System.SR.Cryptography_KeyTooSmall);
105 }
106 Span<byte> destination2 = destination.Slice(destination.Length - source.Length);
107 Span<byte> data = destination.Slice(2, destination.Length - source.Length - 3);
108 destination[0] = 0;
109 destination[1] = 2;
110 destination[data.Length + 2] = 0;
111 FillNonZeroBytes(data);
112 source.CopyTo(destination2);
113 }
static string Cryptography_KeyTooSmall
Definition SR.cs:110
Definition SR.cs:7

References System.SR.Cryptography_KeyTooSmall, System.destination, System.length, System.length2, System.Span< T >.Slice(), and System.source.