# Cryptoleq

Cryptoleq is a language consisting of one, the eponymous, instruction, is capable of performing general-purpose computation on encrypted programs and is a close relative to Subleq. Cryptoleq works on continuous cells of memory using direct and indirect addressing, and performs two operations *O _{1}*

* and *O_{2}* on three values a, b, and c :*

Cryptoleq a, b, c [b] = O_{1}([a],[b]) ; IP = c , if O_{2}[b] ≤ 0 IP = IP + 3 , otherwise

where a, b and c are addressed by the instruction pointer, IP, with the value of IP addressing a, IP + 1 point to b and IP + 2 to c.

In Cryptoleq operations *O _{1}* and

*O*are defined as follows:

_{2}O(_{1}x,y) =x^{-1}_{N2}ymod N^{2}O(_{2}x) = x-1 / N

where x and y are encrypted values based on a cryptographic parameter, N.

The main difference with Subleq is that in Subleq, *O _{1}*(

*x,y*) simply subtracts

*y*from

*x*and

*O*) equals to

_{2}(x*x.*Cryptoleq is also homomorphic to Subleq, modular inversion and multiplication is homomorphic to subtraction and the operation of O

_{2}corresponds the Subleq test if the values were unencrypted. A program written in Subleq can run on a Cryptoleq machine, meaning backwards compatibility. Cryptoleq though, implements fully homomorphic calculations and since the model is be able to do multiplications. Multiplication on an encrypted domain is assisted by a unique function G that is assumed to be difficult to reverse engineer and allows re-encryption of a value based on the O

_{2}operation. G(x,y) equals to encrypted zero if the O

_{2}of the value Nm + 1 is equal or less than zero, m being the unencrypted x, or equals to the re-encrypted y otherwise. The multiplication algorithm is a top-down model that is based on addition and subtraction, uses the function G and does not have conditional jumps nor branches.