C# Class OpenStory.Cryptography.AesTransform

Represents a cryptographic transformer based on the AES algorithm.
Inheritance: CryptoTransformBase
Exibir arquivo Open project: shoftee/OpenStory

Public Methods

Method Description
AesTransform ( byte table, byte vector, byte key ) : System

Initializes a new instance of the AesTransform class.

The provided arrays are copied into the AesTransform instance to avoid mutation.

TransformArraySegment ( byte data, byte vector, int segmentStart, int segmentEnd ) : void

Private Methods

Method Description
FillXorBlock ( byte iv, byte xorBlock ) : void

Fills a 16-element byte array with copies of the specified IV.

GetTransformer ( byte key ) : ICryptoTransform
TransformBlock ( byte data, byte iv, int blockStart, int blockEnd, byte xorBlock ) : void

Performs the AES transformation on a single block of the data.

The parameter xorBlock is used only for performance considerations, to avoid instantiating a new array every time a transformation has to be done. It should not be shorter than 16 elements, and it's unnecessary for it to be longer. Its contents will be overwritten.

Method Details

AesTransform() public method

Initializes a new instance of the AesTransform class.
The provided arrays are copied into the AesTransform instance to avoid mutation.
Thrown if any of the provided parameters is . Thrown if any of the provided parameters has an invalid number of elements.
public AesTransform ( byte table, byte vector, byte key ) : System
table byte The shuffle transformation table.
vector byte The initial value for the shuffle transformation.
key byte The AES key.
return System

TransformArraySegment() public method

public TransformArraySegment ( byte data, byte vector, int segmentStart, int segmentEnd ) : void
data byte
vector byte
segmentStart int
segmentEnd int
return void