# Transformation mechanism

To initially set up a data area in HFHE , it is necessary to convert any initialization value from normal data to a special version of the data with certain property

For acquiring the essential state of data, it's required to parse each bit of the input vector through a transitive system of states (they change dynamically) via the mechanism of transition. Each subsequent bit is transformed with account of previous series and the general indicator of state (so that all values are in a uniform field).

### Basic principles

The transformation is achieved through a system of transitions between states. For each input vector value, calculations are made based on its value and current state.

$P$ is position, which is determined by dividing the value from the states array. Where $S$ is the current state, in $SC$ it is an array with transitions for each state.

A method for updating the states of an array of states $SC[S]$ through the current state $S$, the value of vector $B$ and the previous received position $P$. $GT[N]$ determines the value that scales the change in state.

The new state of $S'$ is determined through a bit OR between shifting the current state of $S$ by 8 positions to the left and the value of the state from the array $St[S]$.

The new state value in the $St[S]$ array is updated by adding the current value from the vector to it and then performing a bitwise AND operation on the number 255 (limiting the result to 8 bits).

The control vector (always needed for comparison with the reference) $C$ is calculated based on the current ranges $VX$ (start value) and $VY$ (end value), as well as the position of $P$.

$MASK$ or $0xffff$ is used to obtain the lower 16 bits from the $VY - VX$ difference so that it can then divide by $2^{16}$. Thus, we obtain the residual shares of the difference $VY - VX$ in the 16-bit area.

This approach to transformation allows us to obtain the necessary representation of the data vector that is used in arithmetic methods on hypergraphs (since the standard representation of the information vector does not allow this).

### Performance

*For the test vector:*

*Transformation takes: 0.000374 s.
RAM used per operation: 2216 bytes.*

Last updated