TestGarbler.java 609 B

12345678910111213141516171819202122232425262728
  1. package com.oblivm.backend.gc.regular;
  2. import java.security.SecureRandom;
  3. import org.junit.Test;
  4. import com.oblivm.backend.gc.GCSignal;
  5. public class TestGarbler {
  6. SecureRandom rnd = new SecureRandom();
  7. GCSignal a = GCSignal.freshLabel(rnd);
  8. GCSignal b = GCSignal.freshLabel(rnd);
  9. GCSignal m = GCSignal.freshLabel(rnd);
  10. GCSignal ret = GCSignal.freshLabel(rnd);
  11. Garbler gb = new Garbler();
  12. public void test() {
  13. gb.enc(a, b, 0, m, ret);
  14. // Assert.assertTrue(m.equals(gb.dec(a, b, 0L, gb.enc(a, b, 0L, m))));
  15. }
  16. @Test
  17. public void test1000() {
  18. for (int i = 0; i < 10000; i++)
  19. test();
  20. }
  21. }