Replace integer arithmetic with more complex expressions. For example, the following identities can be used to encode integer addition:

   x + y = x - ¬ y - 1
         = (x ⊕ y) + 2·(x ∧ y) 
         = (x ∨ y) + (x ∧ y) 
         = 2·(x ∨ y) - (x ⊕ y) 

For example, Tigress might replace

     z = x + y + w
with
  z = (((x ^ y) + ((x & y) << 1)) | w) + 
      (((x ^ y) + ((x & y) << 1)) & w);
 

Diversity

For each operator, there are many possible encodings, and at transformation time, these are selected from randomly.

 

Options

OptionArgumentsDescription
--Transform EncodeArithmetic Replace integer arithmetic with more complex expressions.
--EncodeArithmeitKinds integer Specify the types to encode. Currently, only integer is available. Default=integer.
  • integer = Replace integer arithmetic.
 

Issues

If you apply this transformations too many times you will run into memory issues. For example, here we apply the tranformation 3 times:

	tigress --Environment=x86_64:Darwin:Clang:5.0 \
             --Transform=EncodeArithmetic  \
                --Transform=EncodeArithmetic --Functions=main \
                --Transform=EncodeArithmetic --Functions=main \
                --Transform=EncodeArithmetic --Functions=main \
                     --out=foo_out.c foo.c
where foo.c contains the expression
   x + y == 42

The problem is that after the second transformation the expression has grown to be so huge that the third application runs out of memory. You can fix this, in part, by growing O'Caml's heap:

   setenv OCAMLRUNPARAM 'h=500000000,v=0x5'

You can find other ‚ÄčO'Caml debugging and memory management options here.

 

References