TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class BlockCodec in Tinman.Core.Codec

Abstract base class for IBlockCodec implementations.

abstract class BlockCodec implements IBlockCodec

Public / Attributes

BlockLengthInput

Length of a single input block, in bytes.

public abstract property BlockLengthInput { get }
type int32
value [>0] The input block length, in bytes.
implements IBlockCodec.BlockLengthInput

Remarks:

This is the number of bytes that are read from the input during each call to ProcessBlock().

BlockLengthOutput

Length of a single output block, in bytes.

public abstract property BlockLengthOutput { get }
type int32
value [>0] The output block length, in bytes.
implements IBlockCodec.BlockLengthOutput

Remarks:

This is the number of bytes that are written to the output during each call to ProcessBlock().

Mode

The mode of this block codec.

public abstract property Mode { get }
type CodecMode
value The codec mode.
implements IBlockCodec.Mode

Name

Name of this block codec.

public abstract property Name { get }
type string
value [not-null] The codec name.
implements IBlockCodec.Name

Public / Methods

AES

Creates a new instance of IBlockCodec that implements the symmetric cipher AES.

public static method AES (CodecMode mode, int8[] keyData)
type IBlockCodec
params mode Encode or decode?
  keyData [not-null] Bytes of the cipher key. Must be 128, 192 or 256 bits in length.
returns [not-null] The created IBlockCodec instance.

ProcessBlock

Processes the given input data block.

public abstract method ProcessBlock (ByteBuffer input, ByteBuffer output)
params input [not-null] The input data block. Must have at least BlockLengthInput of Remaining bytes.
  output [not-null] The output data buffer. Must have at least BlockLengthOutput of Remaining bytes.
implements IBlockCodec.ProcessBlock

Processes the given input data block.

public abstract method ProcessBlock (int8[] input, int32 inputOffset, int8[] output, int32 outputOffset)
params input [not-null] The input data block. Must contain at least BlockLengthInput bytes starting at inputOffset.
  inputOffset [>=0] Offset into input to first byte of input data block.
  output [not-null] The output data buffer. Must contain at least BlockLengthOutput bytes starting at outputOffset.
  outputOffset [>=0] Offset into output to first byte of output data buffer.
implements IBlockCodec.ProcessBlock

RSA

Creates a new instance of IBlockCodec that implements the asymmetric cipher RSA.

public static method RSA (CodecMode mode, int32[] modulus, int32[] exponent = null)
type IBlockCodec
params mode Encode or decode?
  modulus [not-null] The shared modulus N of the key.
  exponent The exponent (e or d, depending on Mode) of the key. If null, the value 65537 will be used. Defaults to null.
returns [not-null] The created IBlockCodec instance.

Remarks:

Separate keys are used for encoding and decoding:

(e, N)
(d, N)
where e is the encoding exponent, d is the decoding exponent and N is the shared modulus. A plaintext message m (i.e. a single input block, interpreted as a big integer value) is encrypted into ciphertext c using this formula:
c = m^e % N
m = c^d % N
Big integer values are specified as arrays of 32-bit integers, in big-endian order.