@@ -0,0 +1,1261 @@
+/**%0A * @author Wei Xie%0A * @description Sub-circuit inside the loop of estimating n in 2%5En (to approximate value x)%0A */%0A%0Apackage YaoGC;%0A%0Apublic class SampleCircuit extends CompositeCircuit %7B%0A    private int bitLength;%0A    //TODO read from config: max N as in 2%5En%0A%0A    public SampleCircuit(int l, int k) %7B%0A        // Two input shares, one output, and one sub-circuit in total%0A        super(2 * l, k, 1, %22EstimateNSubstep_%22 + (2 * l) + %22_%22 + (k) );%0A        bitLength = l;%0A    %7D%0A%0A    // Construct the actual circuit%0A    protected void createSubCircuits() throws Exception %7B%0A        subCircuits%5B0%5D = new GT_2L_1(bitLength);%0A%0A        super.createSubCircuits();%0A    %7D%0A%0A    /**%0A     * Connect circuit components using wires%0A     * Inputs in order: (x, est)%0A     */%0A    protected void connectWires() throws Exception %7B%0A    %7D%0A%0A    // Output with two parts: (x, new_estimate)%0A    protected void defineOutputWires() %7B%0A        // Note: +1 implies shift LEFT! (in bit representation, 0 starts from right-most)%0A        for (int i = 0; i %3C bitLength; i++) %7B%0A            outputWires%5B(i + 1 + bitLength) %25 bitLength%5D = inputWires%5Bi%5D;%0A        %7D%0A    %7D%0A%0A    private int leftIn(int i) %7B%0A        return i;%0A    %7D%0A%0A    private int rightIn(int i) %7B%0A        return bitLength + i;%0A    %7D%0A%0A%7D

Add extra circuit (testing only)