We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Cryptoleq

From Esolang
Jump to navigation Jump to search
Cryptoleq processor made at NYU

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 $:

$ {\begin{aligned}{\mathsf {Cryptoleq}}\ a,b,c\qquad [b]&=O_{1}([a],[b])\ ;\\\mathrm {IP} &=c,\ {\mathsf {if}}\ O_{2}([b])\leq 0\\\mathrm {IP} &=\mathrm {IP} +3,\ {\mathsf {otherwise}}\end{aligned}} $

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_{2} $ are defined as follows:

$ {\begin{aligned}O_{1}(x,y)&=x_{N^{2}}^{-1}y\quad {\bmod {N}}^{2}\\O_{2}(x)&=\left\lfloor {\frac {x-1}{N}}\right\rfloor \\\end{aligned}} $

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_{2}(x) $ equals to $ 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.

External Resources