The presented method belongs to the HFHE scheme and is one of its parts that implements a mechanism that supports all types of mathematical operations on encrypted data.
A brief introduction to advanced math operations on hypergraphs
For simplicity, the example uses two vectors of 32 bytes each and the key size is limited to 4 megabytes.
The size of the vectors is chosen for clarity. Optimization is excluded, and checks for the completeness of the data are also excluded, since the size of the vectors can be estimated directly by comparison. The mechanism for transforming data into the “hypergraph space” was described earlier.
If we assume that a single vector with preset settings has been created for the computing base, then the simplest subtraction mechanism can be described as indicated in the code block below.
This code fragment allows us to see the subtraction method between two cipher vectors. The description of the subtraction method comes down to one simple formula:
The transformed hypergraphs are obtained by directly inverting each bit of the ciphertext. The resulting hypergraph is obtained by subtracting two encryption vectors with a predefined base key.
Implementation of the subtraction method is presented as follows:
The resulting hypergraph obtained after the transformations retains its stability. It can be empirically confirmed.
To confirm the stability of the resulting hypergraph, it is necessary to construct an adjacency matrix, then calculate the first and second moments and find the final variance. Low variance values indicate a coherent data structure.
Construction of an adjacency matrix:
Calculation of the first moment:
Calculation of the second moment:
where:
and:
then:
from this, it follows that:
The structure and clustering of the hypergraph after math transformations, adding new ciphertext elements, and the values of various data remains unchanged despite the progressive increase in noise interference for each operation.
A detailed explanation will be provided in a separate article.
Benchmarks and tests
To illustrate, consider two 32-byte vectors. Add a key and perform homomorphic subtraction on a moderately noisy hypergraph with a predefined noise level:
letvector_1=[0x59;0x74;0x20;0x08;0x57;0x21;0x4d;0x69;0x4d;0x04;0x59;0x1a;0xc2;0x84;0x35;0xc2;0xb5;0x6f;0x2c;0x9a;0x7b;0xff;0xde;0x3a;0x17;0xe5;0x8b;0x21;0xa4;0xd0;0x3e;0x90;0x49] inletvector_2=[0x35;0x44;0x15;0x09;0x67;0x12;0x3d;0x59;0x3d;0x14;0x49;0x2a;0xb2;0x94;0x25;0xa2;0xa5;0x1b;0x6e;0x88;0x7c;0x44;0x31;0xd2;0x6a;0x5d;0x8f;0x93;0x71;0x58;0xb7;0x0e;0x2b] in
Let's define the basis for computation as follows: