Crate mightrix

source ·
Expand description

The mightrix crate exposes matrix types that let continuous memory be used as if it where a matrix. The dimensions of the matrix is asserted through const generics. This way the owned variant of the matrix (Stacktrix) can use a fixed size array on the stack.

This library does not aim to be a math library and therefore does not implement common matrix operations, though they might be implemented over time.

This crate is currently used to implement the aes algorithm. In that algorithm the state is represented as a collumn first ColumnPrio matrix, and all operations are done on that Matrix.

Currently there are two matrix types:

  • Reftrix: This matrix uses a mutable slice and therefore manipulates the data directly.

  • Stacktrix: This matrix copies the data and uses a fixed size array on the stack, this way the original data is not manipulated.

Structs

  • The Column struct represents a mutable matrix collumn in all RowPrio matrices.
  • The Column struct represents a mutable matrix collumn in all RowPrio matrices.
  • Matrices (Reftrix, Stacktrix) with Columnprio use a collumn first memory representation.
  • Reftrix allows a mutable slice to be used as a Matrix.
  • The Row struct represents a imutable matrix row in all ColumnPrio matrices.
  • The RowMut struct represents a mutable matrix row in all ColumnPrio matrices.
  • Matrices (Reftrix, Stacktrix) with RowPrio use a row first memory representation.
  • Stacktrix allows a stack based array to be used as a Matrix.

Traits

  • ColumnPrioMatrix encapsulates all functionality a matrix has that uses the memory interpretation ColumnPrio.
  • RowPrioMatrix encapsulates all functionality a matrix has that uses the memory interpretation RowPrio.