test_class.file: demos/aes/src/test/java/dk/alexandra/fresco/demo/TestAesDemo.java
test_class.identifier: TestAesDemo
test_case.body: @Test
    public void testAESDemo() {
      int noPlayers = 2;
      List<Integer> ports = NetworkUtil.getFreePorts(noPlayers);
      Map<Integer, NetworkConfiguration> netConf =
          NetworkUtil.getNetworkConfigurations(ports);
      Map<Integer, TestThreadConfiguration<ResourcePoolImpl, ProtocolBuilderBinary>> conf =
          new HashMap<>();
      for (int playerId : netConf.keySet()) {
        ProtocolSuite<ResourcePoolImpl, ProtocolBuilderBinary> suite =
            new DummyBooleanProtocolSuite();
        ProtocolEvaluator<ResourcePoolImpl> evaluator =
            new BatchedProtocolEvaluator<>(new SequentialStrategy<>(), suite);
        SecureComputationEngine<ResourcePoolImpl, ProtocolBuilderBinary> sce =
            new SecureComputationEngineImpl<>(suite, evaluator);
        TestThreadConfiguration<ResourcePoolImpl, ProtocolBuilderBinary> ttc =
            new TestThreadConfiguration<>(
                sce,
                () -> new ResourcePoolImpl(playerId, noPlayers),
                () -> new SocketNetwork(netConf.get(playerId)));
        conf.put(playerId, ttc);
      }
  
      TestThreadFactory<ResourcePoolImpl, ProtocolBuilderBinary> f =
          new TestThreadFactory<ResourcePoolImpl, ProtocolBuilderBinary>() {
            @Override
            public TestThread<ResourcePoolImpl, ProtocolBuilderBinary> next() {
              return new TestThread<ResourcePoolImpl, ProtocolBuilderBinary>() {
  
                @Override
                public void test() throws Exception {
  
                  Boolean[] input = null;
                  if (conf.getMyId() == 2) {
                    // 128-bit AES plaintext block
                    input = ByteAndBitConverter.toBoolean("00112233445566778899aabbccddeeff");
                  } else if (conf.getMyId() == 1) {
                    // 128-bit key
                    input = ByteAndBitConverter.toBoolean("000102030405060708090a0b0c0d0e0f");
                  }
  
                  AesDemo app = new AesDemo(conf.getMyId(), input);
  
                  List<Boolean> aesResult = runApplication(app);
  
                  // Verify output state.
                  String expected = "69c4e0d86a7b0430d8cdb78070b4c55a"; // expected cipher
                  boolean[] actualBoolean = new boolean[aesResult.size()];
                  int i = 0;
                  for (Boolean b : aesResult) {
                    actualBoolean[i++] = b;
                  }
                  String actual = ByteAndBitConverter.toHex(actualBoolean);
                  Assert.assertEquals(expected, actual);
  
                }
              };
            }
          };
  
      TestThreadRunner.run(f, conf);
    }
test_case.class_method_signature: TestAesDemo.testAESDemo()
test_case.full_signature: @Test public void testAESDemo()
test_case.identifier: testAESDemo
test_case.invocations: getFreePorts getNetworkConfigurations keySet get put getMyId toBoolean getMyId toBoolean getMyId runApplication size toHex assertEquals run
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAESDemo()
focal_class.declarator: in
focal_class.modifier: private
focal_class.original_string: private Boolean[] in;
focal_class.type: Boolean[]
focal_class.var_name: in
focal_class.declarator: id
focal_class.modifier: private
focal_class.original_string: private int id;
focal_class.type: int
focal_class.var_name: id
focal_class.declarator: BLOCK_SIZE = 128
focal_class.modifier: private static final
focal_class.original_string: private static final int BLOCK_SIZE = 128;
focal_class.type: int
focal_class.var_name: BLOCK_SIZE
focal_class.declarator: INPUT_LENGTH = 32
focal_class.modifier: private static final
focal_class.original_string: private static final int INPUT_LENGTH = 32;
focal_class.type: int
focal_class.var_name: INPUT_LENGTH
focal_class.file: demos/aes/src/main/java/dk/alexandra/fresco/demo/AesDemo.java
focal_class.identifier: AesDemo
focal_class.interfaces: implements Application<List<Boolean>, ProtocolBuilderBinary>
focal_class.class_method_signature: AesDemo.AesDemo(int id, Boolean[] in)
focal_class.full_signature: public  AesDemo(int id, Boolean[] in)
focal_class.identifier: AesDemo
focal_class.modifiers: public
focal_class.parameters: (int id, Boolean[] in)
focal_class.signature:  AesDemo(int id, Boolean[] in)
focal_class.class_method_signature: AesDemo.main(String[] args)
focal_class.full_signature: public static void main(String[] args)
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String[] args)
focal_class.return: void
focal_class.signature: void main(String[] args)
focal_class.class_method_signature: AesDemo.buildComputation(ProtocolBuilderBinary producer)
focal_class.full_signature: @Override public DRes<List<Boolean>> buildComputation(ProtocolBuilderBinary producer)
focal_class.identifier: buildComputation
focal_class.modifiers: @Override public
focal_class.parameters: (ProtocolBuilderBinary producer)
focal_class.return: DRes<List<Boolean>>
focal_class.signature: DRes<List<Boolean>> buildComputation(ProtocolBuilderBinary producer)
focal_method.body: public AesDemo(int id, Boolean[] in) {
      this.in = in;
      this.id = id;
    }
focal_method.class_method_signature: AesDemo.AesDemo(int id, Boolean[] in)
focal_method.full_signature: public  AesDemo(int id, Boolean[] in)
focal_method.identifier: AesDemo
focal_method.modifiers: public
focal_method.parameters: (int id, Boolean[] in)
focal_method.signature:  AesDemo(int id, Boolean[] in)