test_class.file: demos/aes/src/test/java/dk/alexandra/fresco/demo/TestAesDemo.java
test_class.identifier: TestAesDemo
test_case.body: @Test
    public void testAESCmdLine() throws Exception {
      Runnable p1 = () -> {
        try {
          AesDemo.main(
              new String[]{"-i", "1", "-p", "1:localhost:8081", "-p", "2:localhost:8082", "-s",
                  "dummyBool", "-in", "000102030405060708090a0b0c0d0e0f"});
        } catch (IOException e) {
          throw new RuntimeException("Error", e);
        }
      };
  
      Runnable p2 = () -> {
        try {
          AesDemo.main(
              new String[]{"-i", "2", "-p", "1:localhost:8081", "-p", "2:localhost:8082", "-s",
                  "dummyBool", "-in", "00112233445566778899aabbccddeeff"});
        } catch (IOException e) {
          throw new RuntimeException("Error", e);
        }
      };
      Thread t1 = new Thread(p1);
      Thread t2 = new Thread(p2);
      t1.start();
      t2.start();
      t1.join();
      t2.join();
    }
test_case.class_method_signature: TestAesDemo.testAESCmdLine()
test_case.full_signature: @Test public void testAESCmdLine()
test_case.identifier: testAESCmdLine
test_case.invocations: main main start start join join
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAESCmdLine()
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 static <ResourcePoolT extends ResourcePool> void main(String[] args) throws IOException {
      CmdLineUtil<ResourcePoolT, ProtocolBuilderBinary> util = new CmdLineUtil<>();
  
      util.addOption(Option.builder("in")
          .desc("The input to use for encryption. " + "A " + INPUT_LENGTH
              + " char hex string. Required for player 1 and 2. "
              + "For player 1 this is interpreted as the AES key. "
              + "For player 2 this is interpreted as the plaintext block to encrypt.")
          .longOpt("input").hasArg().build());
      
      CommandLine cmd = util.parse(args);
      
      // Get and validate the AES specific input.
      Boolean[] input;
      int myId = util.getNetworkConfiguration().getMyId();
      if (myId == 1 || myId == 2) {
  
        if (!cmd.hasOption("in")) {
          throw new IllegalArgumentException("Player 1 and 2 must submit input");
        } else {
          if (cmd.getOptionValue("in").length() != INPUT_LENGTH) {
            throw new IllegalArgumentException(
                "bad input hex string: must be hex string of length " + INPUT_LENGTH);
          }
          input = ByteAndBitConverter.toBoolean(cmd.getOptionValue("in"));
        }
      } else {
        if (cmd.hasOption("in")) {
          throw new IllegalArgumentException("Only player 1 and 2 should submit input");
        }
        input = ByteAndBitConverter.toBoolean("00000000000000000000000000000000");
      }
  
      
      ProtocolSuite<ResourcePoolT, ProtocolBuilderBinary> psConf = util.getProtocolSuite();
  
      SecureComputationEngine<ResourcePoolT, ProtocolBuilderBinary> sce =
          new SecureComputationEngineImpl<>(psConf, util.getEvaluator());
  
      ResourcePoolT resourcePool = util.getResourcePool();
      AesDemo aes = new AesDemo(util.getNetworkConfiguration().getMyId(), input);
      List<Boolean> aesResult = sce.runApplication(aes, resourcePool, util.getNetwork());
      
      util.closeNetwork();
      sce.shutdownSCE();
  
      // Print result.
      boolean[] res = new boolean[BLOCK_SIZE];
      for (int i = 0; i < BLOCK_SIZE; i++) {
        res[i] = aesResult.get(i);
      }
      System.out.println("The resulting ciphertext is: " + ByteAndBitConverter.toHex(res));
  
    }
focal_method.class_method_signature: AesDemo.main(String[] args)
focal_method.full_signature: public static void main(String[] args)
focal_method.identifier: main
focal_method.invocations: addOption build hasArg longOpt desc builder parse getMyId getNetworkConfiguration hasOption length getOptionValue toBoolean getOptionValue hasOption toBoolean getProtocolSuite getEvaluator getResourcePool getMyId getNetworkConfiguration runApplication getNetwork closeNetwork shutdownSCE get println toHex
focal_method.modifiers: public static
focal_method.parameters: (String[] args)
focal_method.return: void
focal_method.signature: void main(String[] args)