Virtual Machine

Calling compile.py outputs the computation in a format specific to MP-SPDZ. This includes a schedule file and one or several bytecode files. The schedule file can be found at Programs/Schedules/<progname>.sch. It contains the names of all bytecode files found in Programs/Bytecode and the maximum number of parallel threads. Each bytecode file represents the complete computation of one thread, also called tape. The computation of the main thread is always Programs/Bytecode/<progname>-0.bc when compiled by the compiler.

The bytecode is made up of 32-bit units in big-endian byte order. Every unit represents an instruction code (possibly including vector size), register number, or immediate value.

For example, adding the secret integers in registers 1 and 2 and then storing the result at register 0 leads to the following bytecode (in hexadecimal representation):

00 00 00 21  00 00 00 00  00 00 00 01  00 00 00 02

This is because 0x021 is the code of secret integer addition. The debugging output (compile.py -a <prefix>) looks as follows:

adds s0, s1, s2 # <instruction number>

There is also a vectorized addition. Adding 10 secret integers in registers 10-19 and 20-29 and then storing the result in registers 0-9 is represented as follows in bytecode:

00 00 28 21  00 00 00 00  00 00 00 0a  00 00 00 14

This is because the vector size is stored in the upper 22 bits of the first 32-bit unit (instruction codes are up to 10 bits long), and 0x28 equals 40 or 10 shifted by two bits. In the debugging output the vectorized addition looks as follows:

vadds 10, s0, s10, s20 # <instruction number>

Finally, some instructions have a variable number of arguments to accommodate any number of parallel operations. For these, the first argument usually indicates the number of arguments yet to come. For example, multiplying the secret integers in registers 2 and 3 as well as registers 4 and 5 and the storing the two results in registers 0 and 1 results in the following bytecode:

00 00 00 a6  00 00 00 06  00 00 00 00  00 00 00 02
00 00 00 03  00 00 00 01  00 00 00 04  00 00 00 05

and the following debugging output:

muls 6, s0, s2, s3, s1, s4, s5 # <instruction number>

Note that calling instructions in high-level code never is done with the explicit number of arguments. Instead, this is derived from number of function arguments. The example above would this simply be called as follows:

muls(s0, s2, s3, s1, s4, s5)

Instructions

The following table list all instructions except the ones for \(\mathrm{GF}(2^n)\) computation, untested ones, and those considered obsolete.

Name Code  
LDI 0x1 Assign (constant) immediate value to clear register (vector)
LDSI 0x2 Assign (constant) immediate value to secret register (vector)
LDMC 0x3 Assign clear memory value(s) to clear register (vector) by immediate address
LDMS 0x4 Assign secret memory value(s) to secret register (vector) by immediate address
STMC 0x5 Assign clear register (vector) to clear memory value(s) by immediate address
STMS 0x6 Assign secret register (vector) to secret memory value(s) by immediate address
LDMCI 0x7 Assign clear memory value(s) to clear register (vector) by register address
LDMSI 0x8 Assign secret memory value(s) to secret register (vector) by register address
STMCI 0x9 Assign clear register (vector) to clear memory value(s) by register address
STMSI 0xa Assign secret register (vector) to secret memory value(s) by register address
MOVC 0xb Copy clear register (vector)
MOVS 0xc Copy secret register (vector)
LDTN 0x10 Store the number of the current thread in clear integer register
LDARG 0x11 Store the argument passed to the current thread in clear integer register
REQBL 0x12 Requirement on computation modulus
STARG 0x13 Copy clear integer register to the thread argument
TIME 0x14 Output time since start of computation
START 0x15 Start timer
STOP 0x16 Stop timer
USE 0x17 Offline data usage
USE_INP 0x18 Input usage
RUN_TAPE 0x19 Start tape/bytecode file in another thread
JOIN_TAPE 0x1a Join thread
CRASH 0x1b Crash runtime
USE_PREP 0x1c Custom preprocessed data usage
ADDC 0x20 Clear addition
ADDS 0x21 Secret addition
ADDM 0x22 Mixed addition
ADDCI 0x23 Addition of clear register (vector) and (constant) immediate value
ADDSI 0x24 Addition of secret register (vector) and (constant) immediate value
SUBC 0x25 Clear subtraction
SUBS 0x26 Secret subtraction
SUBML 0x27 Subtract clear from secret value
SUBMR 0x28 Subtract secret from clear value
SUBCI 0x29 Subtraction of (constant) immediate value from clear register (vector)
SUBSI 0x2a Subtraction of (constant) immediate value from secret register (vector)
SUBCFI 0x2b Subtraction of clear register (vector) from (constant) immediate value
SUBSFI 0x2c Subtraction of secret register (vector) from (constant) immediate value
MULC 0x30 Clear multiplication
MULM 0x31 Multiply secret and clear value
MULCI 0x32 Multiplication of clear register (vector) and (constant) immediate value
MULSI 0x33 Multiplication of secret register (vector) and (constant) immediate value
DIVC 0x34 Clear division
DIVCI 0x35 Division of secret register (vector) and (constant) immediate value
MODC 0x36 Clear modular reduction
MODCI 0x37 Modular reduction of clear register (vector) and (constant) immediate value
LEGENDREC 0x38 Clear Legendre symbol computation (a/p) over prime p (the computation modulus)
DIGESTC 0x39 Clear truncated hash computation
INV2M 0x3a Inverse of power of two modulo prime (the computation modulus)
TRIPLE 0x50 Store fresh random triple(s) in secret register (vectors)
BIT 0x51 Store fresh random triple(s) in secret register (vectors)
SQUARE 0x52 Store fresh random square(s) in secret register (vectors)
INV 0x53 Store fresh random inverse(s) in secret register (vectors)
PREP 0x57 Store custom preprocessed data in secret register (vectors)
DABIT 0x58 Store fresh random daBit(s) in secret register (vectors)
EDABIT 0x59 Store fresh random loose edaBit(s) in secret register (vectors)
SEDABIT 0x5a Store fresh random strict edaBit(s) in secret register (vectors)
RANDOMS 0x5b Store fresh length-restricted random shares(s) in secret register (vectors)
INPUTMASKREG 0x5c Store fresh random input mask(s) in secret register (vector) and clear register (vector) of the relevant player
RANDOMFULLS 0x5d Store share(s) of a fresh secret random element in secret register (vectors)
READSOCKETC 0x63 Read a variable number of clear values in internal representation from socket for a specified client id and store them in clear registers
READSOCKETINT 0x69 Read a variable number of 32-bit integers from socket for a specified client id and store them in clear integer registers
WRITESOCKETSHARE 0x6b Write a variable number of shares (without MACs) from secret registers into socket for a specified client id
LISTEN 0x6c Open a server socket on a party-specific port number and listen for client connections (non-blocking)
ACCEPTCLIENTCONNECTION 0x6d Wait for a connection at the given port and write socket handle to clear integer register
CLOSECLIENTCONNECTION 0x6e Close connection to client
ANDC 0x70 Logical AND of clear (vector) registers
XORC 0x71 Logical XOR of clear (vector) registers
ORC 0x72 Logical OR of clear (vector) registers
ANDCI 0x73 Logical AND of clear register (vector) and (constant) immediate value
XORCI 0x74 Logical XOR of clear register (vector) and (constant) immediate value
ORCI 0x75 Logical OR of clear register (vector) and (constant) immediate value
NOTC 0x76 Clear logical NOT of a constant number of bits of clear (vector) register
SHLC 0x80 Bitwise left shift of clear register (vector)
SHRC 0x81 Bitwise right shift of clear register (vector)
SHLCI 0x82 Bitwise left shift of clear register (vector) by (constant) immediate value
SHRCI 0x83 Bitwise right shift of clear register (vector) by (constant) immediate value
SHRSI 0x84 Bitwise right shift of secret register (vector) by (constant) immediate value
JMP 0x90 Unconditional relative jump in the bytecode (compile-time parameter)
JMPNZ 0x91 Conditional relative jump in the bytecode
JMPEQZ 0x92 Conditional relative jump in the bytecode
EQZC 0x93 Clear integer zero test
LTZC 0x94 Clear integer less than zero test
LTC 0x95 Clear integer less-than comparison
GTC 0x96 Clear integer greater-than comparison
EQC 0x97 Clear integer equality test
JMPI 0x98 Unconditional relative jump in the bytecode (run-time parameter)
BITDECINT 0x99 Clear integer bit decomposition
LDINT 0x9a Store (constant) immediate value in clear integer register (vector)
ADDINT 0x9b Clear integer register (vector) addition
SUBINT 0x9c Clear integer register (vector) subtraction
MULINT 0x9d Clear integer register (element-wise vector) multiplication
DIVINT 0x9e Clear integer register (element-wise vector) division with floor rounding
PRINTINT 0x9f Output clear integer register
OPEN 0xa5 Reveal secret registers (vectors) to clear registers (vectors)
MULS 0xa6 (Element-wise) multiplication of secret registers (vectors)
MULRS 0xa7 Constant-vector multiplication of secret registers
DOTPRODS 0xa8 Dot product of secret registers (vectors)
TRUNC_PR 0xa9 Probabilistic truncation if supported by the protocol
MATMULS 0xaa Secret matrix multiplication from registers
MATMULSM 0xab Secret matrix multiplication reading directly from memory
CONV2DS 0xac Secret 2D convolution
PRINTREG 0xb1 Debugging output of clear register (vector)
RAND 0xb2 Store insecure random value of specified length in clear integer register (vector)
PRINTREGPLAIN 0xb3 Output clear register
PRINTCHR 0xb4 Output a single byte
PRINTSTR 0xb5 Output four bytes
PUBINPUT 0xb6 Store public input in clear register (vector)
PRINTFLOATPLAIN 0xbc Output floating-number from clear registers
WRITEFILESHARE 0xbd Write shares to Persistence/Transactions-P<playerno>.data (appending at the end)
READFILESHARE 0xbe Read shares from Persistence/Transactions-P<playerno>.data
CONDPRINTSTR 0xbf Conditionally output four bytes
CONVINT 0xc0 Convert clear integer register (vector) to clear register (vector)
CONVMODP 0xc1 Convert clear integer register (vector) to clear register (vector)
LDMINT 0xca Assign clear integer memory value(s) to clear integer register (vector) by immediate address
STMINT 0xcb Assign clear integer register (vector) to clear integer memory value(s) by immediate address
LDMINTI 0xcc Assign clear integer memory value(s) to clear integer register (vector) by register address
STMINTI 0xcd Assign clear integer register (vector) to clear integer memory value(s) by register address
PUSHINT 0xce Pushes clear integer register to the thread-local stack
POPINT 0xcf Pops from the thread-local stack to clear integer register
MOVINT 0xd0 Copy clear integer register (vector)
INCINT 0xd1 Create incremental clear integer vector
SHUFFLE 0xd2 Randomly shuffles clear integer vector with public randomness
PRINTFLOATPREC 0xe0 Set number of digits after decimal point for print_float_plain
CONDPRINTPLAIN 0xe1 Conditionally output clear register (with precision)
NPLAYERS 0xe2 Store number of players in clear integer register
THRESHOLD 0xe3 Store maximal number of corrupt players in clear integer register
PLAYERID 0xe4 Store current player number in clear integer register
USE_EDABIT 0xe5 edaBit usage
INPUTMIXED 0xf2 Store private input in secret registers (vectors)
INPUTMIXEDREG 0xf3 Store private input in secret registers (vectors)
RAWINPUT 0xf4 Store private input in secret registers (vectors)
XORS 0x200 Bitwise XOR of secret bit register vectors
XORM 0x201 Bitwise XOR of single secret and clear bit registers
ANDRS 0x202 Constant-vector AND of secret bit registers
BITDECS 0x203 Secret bit register decomposition
BITCOMS 0x204 Secret bit register decomposition
CONVSINT 0x205 Copy clear integer register to secret bit register
LDBITS 0x20a Store immediate in secret bit register
ANDS 0x20b Bitwise AND of secret bit register vector
TRANS 0x20c Secret bit register vector transpose
BITB 0x20d Copy fresh secret random bit to secret bit register
ANDM 0x20e Bitwise AND of single secret and clear bit registers
NOTS 0x20f Bitwise NOT of secret register vector
XORCBI 0x210 Bitwise XOR of single clear bit register and immediate
BITDECC 0x211 Secret bit register decomposition
CONVCINT 0x213 Copy clear integer register to clear bit register

Compiler.instructions module

This module contains all instruction types for arithmetic computation and general control of the virtual machine such as control flow.

The parameter descriptions refer to the instruction arguments in the right order.

class Compiler.instructions.acceptclientconnection(*args, **kwargs)[source]

Wait for a connection at the given port and write socket handle to clear integer register.

Param:client id destination (regint)
Param:port number (int)
Compiler.instructions.addc(*args, **kwargs)[source]

Clear addition.

Param:result (cint)
Param:summand (cint)
Param:summand (cint)
Compiler.instructions.addci(*args, **kwargs)[source]

Addition of clear register (vector) and (constant) immediate value.

Param:result (cint)
Param:summand (cint)
Param:summand (int)
Compiler.instructions.addint(*args, **kwargs)[source]

Clear integer register (vector) addition.

Param:result (regint)
Param:summand (regint)
Param:summand (regint)
Compiler.instructions.addm(*args, **kwargs)[source]

Mixed addition.

Param:result (sint)
Param:summand (sint)
Param:summand (cint)
Compiler.instructions.adds(*args, **kwargs)[source]

Secret addition.

Param:result (sint)
Param:summand (sint)
Param:summand (sint)
Compiler.instructions.addsi(*args, **kwargs)[source]

Addition of secret register (vector) and (constant) immediate value.

Param:result (cint)
Param:summand (cint)
Param:summand (int)
Compiler.instructions.andc(*args, **kwargs)[source]

Logical AND of clear (vector) registers.

Param:result (cint)
Param:operand (cint)
Param:operand (cint)
Compiler.instructions.andci(*args, **kwargs)[source]

Logical AND of clear register (vector) and (constant) immediate value.

Param:result (cint)
Param:operand (cint)
Param:operand (int)
Compiler.instructions.asm_open(*args, **kwargs)[source]

Reveal secret registers (vectors) to clear registers (vectors).

Param:number of argument to follow (multiple of two)
Param:destination (cint)
Param:source (sint)
Param:(repeat the last two)…
Compiler.instructions.bit(*args, **kwargs)[source]

Store fresh random triple(s) in secret register (vectors).

Param:destination (sint)
Compiler.instructions.bitdecint(*args, **kwargs)[source]

Clear integer bit decomposition.

Param:number of arguments to follow / number of bits minus one (int)
Param:source (regint)
Param:destination for least significant bit (regint)
Param:(destination for one bit higher)…
class Compiler.instructions.closeclientconnection(*args, **kwargs)[source]

Close connection to client.

Param:client id (regint)
class Compiler.instructions.cond_print_plain(*args, **kwargs)[source]

Conditionally output clear register (with precision). Outputs \(x \cdot 2^p\) where \(p\) is the precision.

Param:condition (cint, no output if zero)
Param:source (cint)
Param:precision (cint)
class Compiler.instructions.cond_print_str(cond, val)[source]

Conditionally output four bytes.

Param:condition (cint, no output if zero)
Param:four bytes (int)
class Compiler.instructions.conv2ds(*args, **kwargs)[source]

Secret 2D convolution.

Param:result (sint vector in row-first order)
Param:inputs (sint vector in row-first order)
Param:weights (sint vector in row-first order)
Param:output height (int)
Param:output width (int)
Param:input height (int)
Param:input width (int)
Param:weight height (int)
Param:weight width (int)
Param:stride height (int)
Param:stride width (int)
Param:number of channels (int)
Param:padding height (int)
Param:padding width (int)
Compiler.instructions.convint(*args, **kwargs)[source]

Convert clear integer register (vector) to clear register (vector).

Param:destination (cint)
Param:source (regint)
Compiler.instructions.convmodp(*args, **kwargs)[source]

Convert clear integer register (vector) to clear register (vector). If the bit length is zero, the unsigned conversion is used, otherwise signed conversion is used. This makes a difference when computing modulo a prime \(p\). Signed conversion of \(p-1\) results in -1 while signed conversion results in \((p-1) \mod 2^{64}\).

Param:destination (regint)
Param:source (cint)
Param:bit length (int)
class Compiler.instructions.crash(*args, **kwargs)[source]

Crash runtime.

Compiler.instructions.dabit(*args, **kwargs)[source]

Store fresh random daBit(s) in secret register (vectors).

Param:arithmetic part (sint)
Param:binary part (sbit)
Compiler.instructions.digestc(*args, **kwargs)[source]

Clear truncated hash computation.

Param:result (cint)
Param:input (cint)
Param:byte length of hash value used (int)
Compiler.instructions.divc(*args, **kwargs)[source]

Clear division.

Param:result (cint)
Param:dividend (cint)
Param:divisor (cint)
Compiler.instructions.divci(*args, **kwargs)[source]

Division of secret register (vector) and (constant) immediate value.

Param:result (cint)
Param:dividend (cint)
Param:divisor (int)
Compiler.instructions.divint(*args, **kwargs)[source]

Clear integer register (element-wise vector) division with floor rounding.

Param:result (regint)
Param:dividend (regint)
Param:divisor (regint)
Compiler.instructions.dotprods(*args)[source]

Dot product of secret registers (vectors). Note that the vectorized version works element-wise.

Param:number of arguments to follow (int)
Param:twice the dot product length plus two (I know…)
Param:result (sint)
Param:first factor (sint)
Param:first factor (sint)
Param:second factor (sint)
Param:second factor (sint)
Param:(remaining factors)…
Param:(repeat from dot product length)…
Compiler.instructions.edabit(*args, **kwargs)[source]

Store fresh random loose edaBit(s) in secret register (vectors). The length is the first argument minus one.

Param:number of arguments to follow / number of bits plus two (int)
Param:arithmetic (sint)
Param:binary (sbit)
Param:(binary)…
Compiler.instructions.eqc(*args, **kwargs)[source]

Clear integer equality test. The result is 1 if the operands are equal and 0 otherwise.

Param:destination (regint)
Param:first operand (regint)
Param:second operand (regint)
Compiler.instructions.eqzc(*args, **kwargs)[source]

Clear integer zero test. The result is 1 for true and 0 for false.

Param:destination (regint)
Param:operand (regint)
Compiler.instructions.gtc(*args, **kwargs)[source]

Clear integer greater-than comparison. The result is 1 if the first operand is greater and 0 otherwise.

Param:destination (regint)
Param:first operand (regint)
Param:second operand (regint)
class Compiler.instructions.incint(*args, **kwargs)[source]

Create incremental clear integer vector. For example, vector size 10, base 1, increment 2, repeat 3, and wrap 2 produces the following:

(1, 1, 1, 3, 3, 3, 1, 1, 1, 3)

This is because the first number is always the base, every number is repeated repeat times, after which increment is added, and after wrap increments the number returns to base.

Param:destination (regint)
Param:base (non-vector regint)
Param:increment (int)
Param:repeat (int)
Param:wrap (int)
Compiler.instructions.inputmaskreg(*args, **kwargs)[source]

Store fresh random input mask(s) in secret register (vector) and clear register (vector) of the relevant player.

Param:mask (sint)
Param:mask (cint, player only)
Param:player (regint)
Compiler.instructions.inputmixed(name, *args)[source]

Store private input in secret registers (vectors). The input is read as integer or floating-point number and the latter is then converted to the internal representation using the given precision. This instruction uses compile-time player numbers.

Param:number of arguments to follow (int)
Param:type (0: integer, 1: fixed-point, 2: floating-point)
Param:destination (sint)
Param:destination (sint, only for floating-point)
Param:destination (sint, only for floating-point)
Param:destination (sint, only for floating-point)
Param:fixed-point precision or precision of floating-point significand (int, not with integer)
Param:input player (int)
Param:(repeat from type parameter)…
Compiler.instructions.inputmixedreg(name, *args)[source]

Store private input in secret registers (vectors). The input is read as integer or floating-point number and the latter is then converted to the internal representation using the given precision. This instruction uses run-time player numbers.

Param:number of arguments to follow (int)
Param:type (0: integer, 1: fixed-point, 2: floating-point)
Param:destination (sint)
Param:destination (sint, only for floating-point)
Param:destination (sint, only for floating-point)
Param:destination (sint, only for floating-point)
Param:fixed-point precision or precision of floating-point significand (int, not with integer)
Param:input player (regint)
Param:(repeat from type parameter)…
Compiler.instructions.inv2m(*args, **kwargs)[source]

Inverse of power of two modulo prime (the computation modulus).

Param:result (cint)
Param:exponent (int)
Compiler.instructions.inverse(*args, **kwargs)[source]

Store fresh random inverse(s) in secret register (vectors).

Param:value (sint)
Param:inverse (sint)
class Compiler.instructions.jmp(*args, **kwargs)[source]

Unconditional relative jump in the bytecode (compile-time parameter). The parameter is added to the regular jump of one after every instruction. This means that a jump of 0 results in a no-op while a jump of -1 results in an infinite loop.

Param:number of instructions (int)
class Compiler.instructions.jmpeqz(*args, **kwargs)[source]

Conditional relative jump in the bytecode. The parameter is added to the regular jump of one after every instruction. This means that a jump of 0 results in a no-op while a jump of -1 results in an infinite loop.

Param:condition (regint, only jump if zero)
Param:number of instructions (int)
class Compiler.instructions.jmpi(*args, **kwargs)[source]

Unconditional relative jump in the bytecode (run-time parameter). The parameter is added to the regular jump of one after every instruction. This means that a jump of 0 results in a no-op while a jump of -1 results in an infinite loop.

Param:number of instructions (regint)
class Compiler.instructions.jmpnz(*args, **kwargs)[source]

Conditional relative jump in the bytecode. The parameter is added to the regular jump of one after every instruction. This means that a jump of 0 results in a no-op while a jump of -1 results in an infinite loop.

Param:condition (regint, only jump if not zero)
Param:number of instructions (int)
class Compiler.instructions.join_tape(*args, **kwargs)[source]

Join thread.

Param:virtual machine thread number (int)
Compiler.instructions.ldarg(*args, **kwargs)[source]

Store the argument passed to the current thread in clear integer register.

Param:destination (regint)
Compiler.instructions.ldi(*args, **kwargs)[source]

Assign (constant) immediate value to clear register (vector).

Param:destination (cint)
Param:value (int)
Compiler.instructions.ldint(*args, **kwargs)[source]

Store (constant) immediate value in clear integer register (vector).

Param:destination (regint)
Param:immediate (int)
Compiler.instructions.ldmc(*args, **kwargs)[source]

Assign clear memory value(s) to clear register (vector) by immediate address. The vectorized version starts at the base address and then iterates the memory address.

Param:destination (cint)
Param:memory address base (int)
Compiler.instructions.ldmci(*args, **kwargs)[source]

Assign clear memory value(s) to clear register (vector) by register address. The vectorized version starts at the base address and then iterates the memory address.

Param:destination (cint)
Param:memory address base (regint)
Compiler.instructions.ldmint(*args, **kwargs)[source]

Assign clear integer memory value(s) to clear integer register (vector) by immediate address. The vectorized version starts at the base address and then iterates the memory address.

Param:destination (regint)
Param:memory address base (int)
Compiler.instructions.ldminti(*args, **kwargs)[source]

Assign clear integer memory value(s) to clear integer register (vector) by register address. The vectorized version starts at the base address and then iterates the memory address.

Param:destination (regint)
Param:memory address base (regint)
Compiler.instructions.ldms(*args, **kwargs)[source]

Assign secret memory value(s) to secret register (vector) by immediate address. The vectorized version starts at the base address and then iterates the memory address.

Param:destination (sint)
Param:memory address base (int)
Compiler.instructions.ldmsi(*args, **kwargs)[source]

Assign secret memory value(s) to secret register (vector) by register address. The vectorized version starts at the base address and then iterates the memory address.

Param:destination (sint)
Param:memory address base (regint)
Compiler.instructions.ldsi(*args, **kwargs)[source]

Assign (constant) immediate value to secret register (vector).

Param:destination (sint)
Param:value (int)
Compiler.instructions.ldtn(*args, **kwargs)[source]

Store the number of the current thread in clear integer register.

Param:destination (regint)
Compiler.instructions.legendrec(*args, **kwargs)[source]

Clear Legendre symbol computation (a/p) over prime p (the computation modulus).

Param:result (cint)
Param:a (int)
class Compiler.instructions.listen(*args, **kwargs)[source]

Open a server socket on a party-specific port number and listen for client connections (non-blocking).

Param:port number (int)
Compiler.instructions.ltc(*args, **kwargs)[source]

Clear integer less-than comparison. The result is 1 if the first operand is less and 0 otherwise.

Param:destination (regint)
Param:first operand (regint)
Param:second operand (regint)
Compiler.instructions.ltzc(*args, **kwargs)[source]

Clear integer less than zero test. The result is 1 for true and 0 for false.

Param:destination (regint)
Param:operand (regint)
class Compiler.instructions.matmuls(*args, **kwargs)[source]

Secret matrix multiplication from registers. All matrices are represented as vectors in row-first order.

Param:result (sint vector)
Param:first factor (sint vector)
Param:second factor (sint vector)
Param:number of rows in first factor and result (int)
Param:number of columns in first factor and rows in second factor (int)
Param:number of columns in second factor and result (int)
class Compiler.instructions.matmulsm(*args, **kwargs)[source]

Secret matrix multiplication reading directly from memory.

Param:result (sint vector in row-first order)
Param:base address of first factor (regint value)
Param:base address of second factor (regint value)
Param:number of rows in first factor and result (int)
Param:number of columns in first factor and rows in second factor (int)
Param:number of columns in second factor and result (int)
Param:rows of first factor to use (regint vector, length as number of rows in first factor)
Param:columns of first factor to use (regint vector, length below)
Param:rows of second factor to use (regint vector, length below)
Param:columns of second factor to use (regint vector, length below)
Param:number of columns of first / rows of second factor to use (int)
Param:number of columns of second factor to use (int)
Compiler.instructions.modc(*args, **kwargs)[source]

Clear modular reduction.

Param:result (cint)
Param:dividend (cint)
Param:divisor (cint)
Compiler.instructions.modci(*args, **kwargs)[source]

Modular reduction of clear register (vector) and (constant) immediate value.

Param:result (cint)
Param:dividend (cint)
Param:divisor (int)
Compiler.instructions.movc(*args, **kwargs)[source]

Copy clear register (vector).

Param:destination (cint)
Param:source (cint)
Compiler.instructions.movint(*args, **kwargs)[source]

Copy clear integer register (vector).

Param:destination (regint)
Param:source (regint)
Compiler.instructions.movs(*args, **kwargs)[source]

Copy secret register (vector).

Param:destination (cint)
Param:source (cint)
Compiler.instructions.mulc(*args, **kwargs)[source]

Clear multiplication.

Param:result (cint)
Param:factor (cint)
Param:factor (cint)
Compiler.instructions.mulci(*args, **kwargs)[source]

Multiplication of clear register (vector) and (constant) immediate value.

Param:result (cint)
Param:factor (cint)
Param:factor (int)
Compiler.instructions.mulint(*args, **kwargs)[source]

Clear integer register (element-wise vector) multiplication.

Param:result (regint)
Param:factor (regint)
Param:factor (regint)
Compiler.instructions.mulm(*args, **kwargs)[source]

Multiply secret and clear value.

Param:result (sint)
Param:factor (sint)
Param:factor (cint)
Compiler.instructions.mulrs(res, x, y)[source]

Constant-vector multiplication of secret registers.

Param:number of arguments to follow (multiple of four)
Param:vector size (int)
Param:result (sint)
Param:vector factor (sint)
Param:constant factor (sint)
Param:(repeat the last four)…
Compiler.instructions.muls(*args, **kwargs)[source]

(Element-wise) multiplication of secret registers (vectors).

Param:number of arguments to follow (multiple of three)
Param:result (sint)
Param:factor (sint)
Param:factor (sint)
Param:(repeat the last three)…
Compiler.instructions.mulsi(*args, **kwargs)[source]

Multiplication of secret register (vector) and (constant) immediate value.

Param:result (sint)
Param:factor (sint)
Param:factor (int)
Compiler.instructions.notc(*args, **kwargs)[source]

Clear logical NOT of a constant number of bits of clear (vector) register.

Param:result (cint)
Param:operand (cint)
Param:bit length (int)
class Compiler.instructions.nplayers(*args, **kwargs)[source]

Store number of players in clear integer register.

Param:destination (regint)
Compiler.instructions.orc(*args, **kwargs)[source]

Logical OR of clear (vector) registers.

Param:result (cint)
Param:operand (cint)
Param:operand (cint)
Compiler.instructions.orci(*args, **kwargs)[source]

Logical OR of clear register (vector) and (constant) immediate value.

Param:result (cint)
Param:operand (cint)
Param:operand (int)
class Compiler.instructions.playerid(*args, **kwargs)[source]

Store current player number in clear integer register.

Param:destination (regint)
Compiler.instructions.popint(*args, **kwargs)[source]

Pops from the thread-local stack to clear integer register.

Param:destination (regint)
Compiler.instructions.prep(*args, **kwargs)[source]

Store custom preprocessed data in secret register (vectors).

Param:number of arguments to follow (int)
Param:tag (16 bytes / 4 units, cut off at first zero byte)
Param:destination (sint)
Param:(repeat destination)…
class Compiler.instructions.print_char(ch)[source]

Output a single byte.

Param:byte (int)
class Compiler.instructions.print_char4(val)[source]

Output four bytes.

Param:four bytes (int)
Compiler.instructions.print_float_plain(*args, **kwargs)[source]

Output floating-number from clear registers.

Param:significand (cint)
Param:exponent (cint)
Param:zero bit (cint, zero output if bit is one)
Param:sign bit (cint, negative output if bit is one)
Param:NaN (cint, regular number if zero)
class Compiler.instructions.print_float_prec(*args, **kwargs)[source]

Set number of digits after decimal point for print_float_plain.

Param:number of digits (int)
class Compiler.instructions.print_int(*args, **kwargs)[source]

Output clear integer register.

Param:source (regint)
Compiler.instructions.print_reg(reg, comment='')[source]

Debugging output of clear register (vector).

Param:source (cint)
Param:comment (4 bytes / 1 unit)
Compiler.instructions.print_reg_plain(*args, **kwargs)[source]

Output clear register.

Param:source (cint)
Compiler.instructions.pubinput(*args, **kwargs)[source]

Store public input in clear register (vector).

Param:destination (cint)
Compiler.instructions.pushint(*args, **kwargs)[source]

Pushes clear integer register to the thread-local stack.

Param:source (regint)
Compiler.instructions.rand(*args, **kwargs)[source]

Store insecure random value of specified length in clear integer register (vector).

Param:destination (regint)
Param:length (regint)
Compiler.instructions.randomfulls(*args, **kwargs)[source]

Store share(s) of a fresh secret random element in secret register (vectors).

Param:destination (sint)
Compiler.instructions.randoms(*args, **kwargs)[source]

Store fresh length-restricted random shares(s) in secret register (vectors). This is only implemented for protocols that also implement local share conversion with split.

Param:destination (sint)
Param:length (int)
Compiler.instructions.rawinput(*args, **kwargs)[source]

Store private input in secret registers (vectors). The input is read in the internal binary format according to the protocol.

Param:number of arguments to follow (multiple of two)
Param:player number (int)
Param:destination (sint)
class Compiler.instructions.readsharesfromfile(*args, **kwargs)[source]

Read shares from Persistence/Transactions-P<playerno>.data.

Param:number of arguments to follow / number of shares plus two (int)
Param:starting position in number of shares from beginning (regint)
Param:destination for final position, -1 for eof reached, or -2 for file not found (regint)
Param:destination for share (sint)
Param:(repeat from destination for share)…
Compiler.instructions.readsocketc(*args, **kwargs)[source]

Read a variable number of clear values in internal representation from socket for a specified client id and store them in clear registers.

Param:number of arguments to follow / number of inputs minus one (int)
Param:client id (regint)
Param:destination (cint)
Param:(repeat destination)…
Compiler.instructions.readsocketint(*args, **kwargs)[source]

Read a variable number of 32-bit integers from socket for a specified client id and store them in clear integer registers.

Param:number of arguments to follow / number of inputs minus one (int)
Param:client id (regint)
Param:destination (regint)
Param:(repeat destination)…
Compiler.instructions.reqbl(*args, **kwargs)[source]

Requirement on computation modulus. Minimal bit length of prime if positive, minus exact bit length of power of two if negative.

Param:requirement (int)
class Compiler.instructions.run_tape(*args, **kwargs)[source]

Start tape/bytecode file in another thread.

Param:number of arguments to follow (multiple of three)
Param:tape number (int)
Param:virtual machine thread number (int)
Param:tape argument (int)
Param:(repeat the last three)…
Compiler.instructions.sedabit(*args, **kwargs)[source]

Store fresh random strict edaBit(s) in secret register (vectors). The length is the first argument minus one.

Param:number of arguments to follow / number of bits plus two (int)
Param:arithmetic (sint)
Param:binary (sbit)
Param:(binary)…
Compiler.instructions.shlc(*args, **kwargs)[source]

Bitwise left shift of clear register (vector).

Param:result (cint)
Param:first operand (cint)
Param:second operand (cint)
Compiler.instructions.shlci(*args, **kwargs)[source]

Bitwise left shift of clear register (vector) by (constant) immediate value.

Param:result (cint)
Param:first operand (cint)
Param:second operand (int)
Compiler.instructions.shrc(*args, **kwargs)[source]

Bitwise right shift of clear register (vector).

Param:result (cint)
Param:first operand (cint)
Param:second operand (cint)
Compiler.instructions.shrci(*args, **kwargs)[source]

Bitwise right shift of clear register (vector) by (constant) immediate value.

Param:result (cint)
Param:first operand (cint)
Param:second operand (int)
Compiler.instructions.shrsi(*args, **kwargs)[source]

Bitwise right shift of secret register (vector) by (constant) immediate value. This only makes sense in connection with protocols allowing local share conversion (i.e., based on additive secret sharing modulo a power of two). Moreover, the result is not a secret sharing of the right shift of the secret value but needs to be corrected using the overflow. This is explained by Dalskov et al. in the appendix.

Param:result (sint)
Param:first operand (sint)
Param:second operand (int)
class Compiler.instructions.shuffle(*args, **kwargs)[source]

Randomly shuffles clear integer vector with public randomness.

Param:destination (regint)
Param:source (regint)
Compiler.instructions.square(*args, **kwargs)[source]

Store fresh random square(s) in secret register (vectors).

Param:value (sint)
Param:square (sint)
Compiler.instructions.starg(*args, **kwargs)[source]

Copy clear integer register to the thread argument.

Param:source (regint)
class Compiler.instructions.start(*args, **kwargs)[source]

Start timer.

Param:timer number (int)
Compiler.instructions.stmc(*args, **kwargs)[source]

Assign clear register (vector) to clear memory value(s) by immediate address. The vectorized version starts at the base address and then iterates the memory address.

Param:source (cint)
Param:memory address base (int)
Compiler.instructions.stmci(*args, **kwargs)[source]

Assign clear register (vector) to clear memory value(s) by register address. The vectorized version starts at the base address and then iterates the memory address.

Param:source (cint)
Param:memory address base (regint)
Compiler.instructions.stmint(*args, **kwargs)[source]

Assign clear integer register (vector) to clear integer memory value(s) by immediate address. The vectorized version starts at the base address and then iterates the memory address.

Param:source (regint)
Param:memory address base (int)
Compiler.instructions.stminti(*args, **kwargs)[source]

Assign clear integer register (vector) to clear integer memory value(s) by register address. The vectorized version starts at the base address and then iterates the memory address.

Param:source (regint)
Param:memory address base (regint)
Compiler.instructions.stms(*args, **kwargs)[source]

Assign secret register (vector) to secret memory value(s) by immediate address. The vectorized version starts at the base address and then iterates the memory address.

Param:source (sint)
Param:memory address base (int)
Compiler.instructions.stmsi(*args, **kwargs)[source]

Assign secret register (vector) to secret memory value(s) by register address. The vectorized version starts at the base address and then iterates the memory address.

Param:source (sint)
Param:memory address base (regint)
class Compiler.instructions.stop(*args, **kwargs)[source]

Stop timer.

Param:timer number (int)
Compiler.instructions.subc(*args, **kwargs)[source]

Clear subtraction.

Param:result (cint)
Param:first operand (cint)
Param:second operand (cint)
Compiler.instructions.subcfi(*args, **kwargs)[source]

Subtraction of clear register (vector) from (constant) immediate value.

Param:result (cint)
Param:first operand (int)
Param:second operand (cint)
Compiler.instructions.subci(*args, **kwargs)[source]

Subtraction of (constant) immediate value from clear register (vector).

Param:result (cint)
Param:first operand (cint)
Param:second operand (int)
Compiler.instructions.subint(*args, **kwargs)[source]

Clear integer register (vector) subtraction.

Param:result (regint)
Param:first operand (regint)
Param:second operand (regint)
Compiler.instructions.subml(*args, **kwargs)[source]

Subtract clear from secret value.

Param:result (sint)
Param:first operand (sint)
Param:second operand (cint)
Compiler.instructions.submr(*args, **kwargs)[source]

Subtract secret from clear value.

Param:result (sint)
Param:first operand (cint)
Param:second operand (sint)
Compiler.instructions.subs(*args, **kwargs)[source]

Secret subtraction.

Param:result (sint)
Param:first operand (sint)
Param:second operand (sint)
Compiler.instructions.subsfi(*args, **kwargs)[source]

Subtraction of secret register (vector) from (constant) immediate value.

Param:result (sint)
Param:first operand (int)
Param:second operand (sint)
Compiler.instructions.subsi(*args, **kwargs)[source]

Subtraction of (constant) immediate value from secret register (vector).

Param:result (sint)
Param:first operand (sint)
Param:second operand (int)
class Compiler.instructions.threshold(*args, **kwargs)[source]

Store maximal number of corrupt players in clear integer register.

Param:destination (regint)
class Compiler.instructions.time(*args, **kwargs)[source]

Output time since start of computation.

Compiler.instructions.triple(*args, **kwargs)[source]

Store fresh random triple(s) in secret register (vectors).

Param:factor (sint)
Param:factor (sint)
Param:product (sint)
Compiler.instructions.trunc_pr(*args, **kwargs)[source]

Probabilistic truncation if supported by the protocol.

Param:number of arguments to follow (multiple of four)
Param:destination (sint)
Param:source (sint)
Param:bit length of source (int)
Param:number of bits to truncate (int)
class Compiler.instructions.use(*args, **kwargs)[source]

Offline data usage. Necessary to avoid reusage while using preprocessing from files. Also used to multithreading for expensive preprocessing.

Param:domain (0: integer, 1: \(\mathrm{GF}(2^n)\), 2: bit)
Param:type (0: triple, 1: square, 2: bit, 3: inverse, 6: daBit)
Param:number (int, -1 for unknown)
class Compiler.instructions.use_edabit(*args, **kwargs)[source]

edaBit usage. Necessary to avoid reusage while using preprocessing from files. Also used to multithreading for expensive preprocessing.

Param:loose/strict (0/1)
Param:length (int)
Param:number (int, -1 for unknown)
class Compiler.instructions.use_inp(*args, **kwargs)[source]

Input usage. Necessary to avoid reusage while using preprocessing from files.

Param:domain (0: integer, 1: \(\mathrm{GF}(2^n)\), 2: bit)
Param:input player (int)
Param:number (int, -1 for unknown)
Compiler.instructions.use_prep(*args, **kwargs)[source]

Custom preprocessed data usage.

Param:tag (16 bytes / 4 units, cut off at first zero byte)
Param:number of items to use (int, -1 for unknown)
class Compiler.instructions.writesharestofile(*args, **kwargs)[source]

Write shares to Persistence/Transactions-P<playerno>.data (appending at the end).

Param:number of shares (int)
Param:source (sint)
Param:(repeat from source)…
Compiler.instructions.writesocketshare(*args, **kwargs)[source]

Write a variable number of shares (without MACs) from secret registers into socket for a specified client id.

Param:client id (regint)
Param:message type (must be 0)
Param:source (sint)
Param:(repeat source)…
Compiler.instructions.xorc(*args, **kwargs)[source]

Logical XOR of clear (vector) registers.

Param:result (cint)
Param:operand (cint)
Param:operand (cint)
Compiler.instructions.xorci(*args, **kwargs)[source]

Logical XOR of clear register (vector) and (constant) immediate value.

Param:result (cint)
Param:operand (cint)
Param:operand (int)

Compiler.GC.instructions module

This module constrains instructions for binary circuits. Unlike arithmetic instructions, they generally do not use the vector size in the instruction code field. Instead the number of bits affected is given as an extra argument. Also note that a register holds 64 values instead of just one as is the case for arithmetic instructions. Therefore, an instruction for 65-128 bits will affect two registers etc. Similarly, a memory cell holds 64 bits.

class Compiler.GC.instructions.addcb(*args, **kwargs)[source]

Integer addition two single clear bit registers.

Param:result (cbit)
Param:summand (cbit)
Param:summand (cbit)
class Compiler.GC.instructions.addcbi(*args, **kwargs)[source]

Integer addition single clear bit register and immediate.

Param:result (cbit)
Param:summand (cbit)
Param:summand (int)
class Compiler.GC.instructions.andm(*args, **kwargs)[source]

Bitwise AND of single secret and clear bit registers.

Param:number of bits (less or equal 64)
Param:result (sbit)
Param:operand (sbit)
Param:operand (cbit)
class Compiler.GC.instructions.andrs(*args, **kwargs)[source]

Constant-vector AND of secret bit registers.

Param:number of arguments to follow (multiple of four)
Param:number of bits (int)
Param:result vector (sbit)
Param:vector operand (sbit)
Param:single operand (sbit)
Param:(repeat from number of bits)…
class Compiler.GC.instructions.ands(*args, **kwargs)[source]

Bitwise AND of secret bit register vector.

Param:number of arguments to follow (multiple of four)
Param:number of bits (int)
Param:result (sbit)
Param:operand (sbit)
Param:operand (sbit)
Param:(repeat from number of bits)…
class Compiler.GC.instructions.bitb(*args, **kwargs)[source]

Copy fresh secret random bit to secret bit register.

Param:destination (sbit)
class Compiler.GC.instructions.bitcoms(*args, **kwargs)[source]

Secret bit register decomposition.

Param:number of arguments to follow / number of bits plus one (int)
Param:destination (sbit)
Param:source for least significant bit (sbit)
Param:(source for one bit higher)…
class Compiler.GC.instructions.bitdecc(*args, **kwargs)[source]

Secret bit register decomposition.

Param:number of arguments to follow / number of bits plus one (int)
Param:source (sbit)
Param:destination for least significant bit (sbit)
Param:(destination for one bit higher)…
class Compiler.GC.instructions.bitdecs(*args, **kwargs)[source]

Secret bit register decomposition.

Param:number of arguments to follow / number of bits plus one (int)
Param:source (sbit)
Param:destination for least significant bit (sbit)
Param:(destination for one bit higher)…
class Compiler.GC.instructions.cond_print_strb(cond, val)[source]

Conditionally output four bytes.

Param:condition (cbit, no output if zero)
Param:four bytes (int)
class Compiler.GC.instructions.convcbit(*args, **kwargs)[source]

Copy clear bit register to clear integer register.

Param:destination (regint)
Param:source (cbit)
class Compiler.GC.instructions.convcbit2s(*args, **kwargs)[source]

Copy clear bit register vector to secret bit register vector.

Param:number of bits (int)
Param:destination (sbit)
Param:source (cbit)
class Compiler.GC.instructions.convcbitvec(*args)[source]

Copy clear bit register vector to clear register by bit. This means that every element of the destination register vector will hold one bit.

Param:number of bits / vector length (int)
Param:destination (regint)
Param:source (cbit)
class Compiler.GC.instructions.convcint(*args, **kwargs)[source]

Copy clear integer register to clear bit register.

Param:number of bits (int)
Param:destination (cbit)
Param:source (regint)
Compiler.GC.instructions.convcintvec(*args, **kwargs)[source]

Copy clear register vector by bit to clear bit register vectors. This means that the first destination will hold the least significant bits of all inputs etc.

Param:number of arguments to follow / number of bits plus one (int)
Param:source (cint)
Param:destination for least significant bits (sbit)
Param:(destination for bits one step higher)…
class Compiler.GC.instructions.convsint(*args, **kwargs)[source]

Copy clear integer register to secret bit register.

Param:number of bits (int)
Param:destination (sbit)
Param:source (regint)
class Compiler.GC.instructions.inputb(*args, **kwargs)[source]

Copy private input to secret bit register vectors. The input is read as floating-point number, multiplied by a power of two, and then rounded to an integer.

Param:number of arguments to follow (multiple of four)
Param:player number (int)
Param:number of bits in output (int)
Param:exponent to power of two factor (int)
Param:destination (sbit)
class Compiler.GC.instructions.inputbvec(*args, **kwargs)[source]

Copy private input to secret bit registers bit by bit. The input is read as floating-point number, multiplied by a power of two, rounded to an integer, and then decomposed into bits.

Param:total number of arguments to follow (int)
Param:number of arguments to follow for one input / number of bits plus three (int)
Param:exponent to power of two factor (int)
Param:player number (int)
Param:destination for least significant bit (sbit)
Param:(destination for one bit higher)…
Param:(repeat from number of arguments to follow for one input)…
class Compiler.GC.instructions.ldbits(*args, **kwargs)[source]

Store immediate in secret bit register.

Param:destination (sbit)
Param:number of bits (int)
Param:immediate (int)
class Compiler.GC.instructions.ldmcb(*args, **kwargs)[source]

Copy clear bit memory cell with compile-time address to clear bit register.

Param:destination (cbit)
Param:memory address (int)
class Compiler.GC.instructions.ldmsb(*args, **kwargs)[source]

Copy secret bit memory cell with compile-time address to secret bit register.

Param:destination (sbit)
Param:memory address (int)
class Compiler.GC.instructions.ldmsbi(*args, **kwargs)[source]

Copy secret bit memory cell with run-time address to secret bit register.

Param:destination (sbit)
Param:memory address (regint)
class Compiler.GC.instructions.movsb(*args, **kwargs)[source]

Copy secret bit register.

Param:destination (sbit)
Param:source (sbit)
class Compiler.GC.instructions.mulcbi(*args, **kwargs)[source]

Integer multiplication single clear bit register and immediate.

Param:result (cbit)
Param:factor (cbit)
Param:factor (int)
class Compiler.GC.instructions.nots(*args, **kwargs)[source]

Bitwise NOT of secret register vector.

Param:number of bits (less or equal 64)
Param:result (sbit)
Param:operand (sbit)
class Compiler.GC.instructions.print_float_plainb(*args, **kwargs)[source]

Output floating-number from clear bit registers.

Param:significand (cbit)
Param:exponent (cbit)
Param:zero bit (cbit, zero output if bit is one)
Param:sign bit (cbit, negative output if bit is one)
Param:NaN (cbit, regular number if zero)
class Compiler.GC.instructions.print_reg_plainb(*args, **kwargs)[source]

Output clear bit register.

Param:source (cbit)
class Compiler.GC.instructions.print_reg_signed(*args, **kwargs)[source]

Signed output of clear bit register.

Param:bit length (int)
Param:source (cbit)
class Compiler.GC.instructions.print_regb(reg, comment='')[source]

Debug output of clear bit register.

Param:source (cbit)
Param:comment (4 bytes / 1 unit)
class Compiler.GC.instructions.reveal(*args, **kwargs)[source]

Reveal secret bit register vectors and copy result to clear bit register vectors.

Param:number of arguments to follow (multiple of three)
Param:number of bits (int)
Param:destination (cbit)
Param:source (sbit)
Param:(repeat from number of bits)…
class Compiler.GC.instructions.shlcbi(*args, **kwargs)[source]

Left shift of clear bit register by immediate.

Param:destination (cbit)
Param:source (cbit)
Param:number of bits to shift (int)
class Compiler.GC.instructions.shrcbi(*args, **kwargs)[source]

Right shift of clear bit register by immediate.

Param:destination (cbit)
Param:source (cbit)
Param:number of bits to shift (int)
Compiler.GC.instructions.split(*args, **kwargs)[source]

Local share conversion. This instruction use the vector length in the instruction code field.

Param:number of arguments to follow (number of bits times number of additive shares plus one)
Param:source (sint)
Param:first share of least significant bit
Param:second share of least significant bit
Param:(remaining share of least significant bit)…
Param:(repeat from first share for bit one step higher)…
class Compiler.GC.instructions.stmcb(*args, **kwargs)[source]

Copy clear bit register to clear bit memory cell with compile-time address.

Param:source (cbit)
Param:memory address (int)
class Compiler.GC.instructions.stmsb(*args, **kwargs)[source]

Copy secret bit register to secret bit memory cell with compile-time address.

Param:source (sbit)
Param:memory address (int)
class Compiler.GC.instructions.stmsbi(*args, **kwargs)[source]

Copy secret bit register to secret bit memory cell with run-time address.

Param:source (sbit)
Param:memory address (regint)
class Compiler.GC.instructions.trans(*args)[source]

Secret bit register vector transpose. The first destination vector will contain the least significant bits of all source vectors etc.

Param:number of arguments to follow (int)
Param:number of outputs (int)
Param:destination for least significant bits (sbit)
Param:(destination for bits one step higher)…
Param:source (sbit)
Param:(source)…
class Compiler.GC.instructions.xorcb(*args, **kwargs)[source]

Bitwise XOR of two single clear bit registers.

Param:result (cbit)
Param:operand (cbit)
Param:operand (cbit)
class Compiler.GC.instructions.xorcbi(*args, **kwargs)[source]

Bitwise XOR of single clear bit register and immediate.

Param:result (cbit)
Param:operand (cbit)
Param:immediate (int)
class Compiler.GC.instructions.xorm(*args, **kwargs)[source]

Bitwise XOR of single secret and clear bit registers.

Param:number of bits (less or equal 64)
Param:result (sbit)
Param:operand (sbit)
Param:operand (cbit)
class Compiler.GC.instructions.xors(*args, **kwargs)[source]

Bitwise XOR of secret bit register vectors.

Param:number of arguments to follow (multiple of four)
Param:number of bits (int)
Param:result (sbit)
Param:operand (sbit)
Param:operand (sbit)
Param:(repeat from number of bits)…