# Speed up performance of nested function computations

I'm trying to create a model for intensive computations for a homomorphic encryption scheme. The core of my problems is a series of function calls

h00=Function[PadLeft[IntegerDigits[Mod[(#1[[2]]-#1[[1]][[1]])*(#2[[2]]-#2[[1]][[1]]),q],2],wrdLen+1]];


Function SHMult calls all previous functions and depending on the number of simulations this might be repeated a lot of times. Basically, what it does is that it creates a big square matrix hijτ where h00 produces the element {0, 0}, hi0 produces all other elements of the first column, h0j produces all other elements of the first row, and hij produces a submatrix with all other elements of the matrix.
Not also that the indices for i, j, τ might be also large; for example a 256 x 256 matrix of 32-bit values. As a first step I tried to use Compile instead of Function for all these functions with the parallelization option given, but I got errors. Also I tried ParallelTable instead of Table, but I got an error saying that ParallelTable can't be used in a nested environment.
• What is wrdLen? How did you try to call compile? – Feyre Mar 24 '17 at 11:20