From 37c71bfba772c7a5fd882b3b172adfcb62d71ab0 Mon Sep 17 00:00:00 2001
From: Nishant Kumar <t-niskum@microsoft.com>
Date: Fri, 4 Oct 2019 19:13:06 +0530
Subject: [PATCH] Added license in files of sub-folders of EzPC; modified
 codegen of ezpc to output a autogenerated comment for each compiled file;
 synced up the test-suite/precompiled_output folder with actual compiled
 output changes.

---
 EzPC/Docker/Dockerfile                        | 20 ++++++++++++++++
 EzPC/Docker/compile_docker_example.sh         | 20 ++++++++++++++++
 EzPC/Docker/run_docker_example_client.sh      | 20 ++++++++++++++++
 EzPC/Docker/run_docker_example_server.sh      | 20 ++++++++++++++++
 EzPC/EzPC/codegen.ml                          |  3 +++
 EzPC/EzPC/codegenoblivc.ml                    |  3 +++
 EzPC/EzPC/codegenporthos.ml                   |  3 +++
 .../docker_test/docker_arith_example.ezpc     | 24 +++++++++++++++++++
 EzPC/EzPC/docker_test/docker_bin_example.ezpc | 24 +++++++++++++++++++
 .../test_suite/precompiled_output/binop0.cpp  |  3 +++
 .../test_suite/precompiled_output/decl0.cpp   |  3 +++
 .../precompiled_output/dot_product0.cpp       |  3 +++
 .../test_suite/precompiled_output/for0.cpp    |  3 +++
 .../test_suite/precompiled_output/func0.cpp   |  3 +++
 .../test_suite/precompiled_output/if0.cpp     |  3 +++
 .../test_suite/precompiled_output/input0.cpp  |  3 +++
 .../test_suite/precompiled_output/output0.cpp |  3 +++
 .../test_suite/precompiled_output/while0.cpp  |  3 +++
 18 files changed, 164 insertions(+)

diff --git a/EzPC/Docker/Dockerfile b/EzPC/Docker/Dockerfile
index 31f4cc2..1de8f05 100644
--- a/EzPC/Docker/Dockerfile
+++ b/EzPC/Docker/Dockerfile
@@ -1,3 +1,23 @@
+# Authors: Mayank Rathee.
+
+# Copyright:
+# Copyright (c) 2018 Microsoft Research
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
 #Download base image ubuntu
 FROM ubuntu
 
diff --git a/EzPC/Docker/compile_docker_example.sh b/EzPC/Docker/compile_docker_example.sh
index f54b2c4..c0a06bc 100644
--- a/EzPC/Docker/compile_docker_example.sh
+++ b/EzPC/Docker/compile_docker_example.sh
@@ -1,5 +1,25 @@
 #!/bin/sh
 
+# Authors: Mayank Rathee.
+
+# Copyright:
+# Copyright (c) 2018 Microsoft Research
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
 # Switch ocaml version
 echo "================================================================"
 echo "ocaml version switching"
diff --git a/EzPC/Docker/run_docker_example_client.sh b/EzPC/Docker/run_docker_example_client.sh
index adbb074..a8bb9ee 100644
--- a/EzPC/Docker/run_docker_example_client.sh
+++ b/EzPC/Docker/run_docker_example_client.sh
@@ -1,5 +1,25 @@
 #!/bin/bash
 
+# Authors: Mayank Rathee.
+
+# Copyright:
+# Copyright (c) 2018 Microsoft Research
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
 cd ../../ABY-latest/ABY/build/bin/
 rm -r client
 mkdir client
diff --git a/EzPC/Docker/run_docker_example_server.sh b/EzPC/Docker/run_docker_example_server.sh
index 7a528cb..626e6a1 100644
--- a/EzPC/Docker/run_docker_example_server.sh
+++ b/EzPC/Docker/run_docker_example_server.sh
@@ -1,5 +1,25 @@
 #!/bin/bash
 
+# Authors: Mayank Rathee.
+
+# Copyright:
+# Copyright (c) 2018 Microsoft Research
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
 cd ../../ABY-latest/ABY/build/bin/
 rm -r server
 mkdir server
diff --git a/EzPC/EzPC/codegen.ml b/EzPC/EzPC/codegen.ml
index 27d0178..5b66636 100644
--- a/EzPC/EzPC/codegen.ml
+++ b/EzPC/EzPC/codegen.ml
@@ -676,6 +676,9 @@ let o_global (g0:gamma) (d:global) :comp * gamma =
 
 let prelude_string :string =
 "\
+/*\n\
+This is an autogenerated file, generated using the EzPC compiler.\n\
+*/\n\
 #include<vector>\n\
 #include<math.h>\n\
 #include<cstdlib>\n\
diff --git a/EzPC/EzPC/codegenoblivc.ml b/EzPC/EzPC/codegenoblivc.ml
index 22792d5..84e2be0 100644
--- a/EzPC/EzPC/codegenoblivc.ml
+++ b/EzPC/EzPC/codegenoblivc.ml
@@ -404,6 +404,9 @@ let o_global (d:global) :comp =
 
 let c_prelude_string : string = 
 "\
+/*\n\
+This is an autogenerated file, generated using the EzPC compiler.\n\
+*/\n\
 #include <stdio.h>\n\
 #include <stdlib.h>\n\
 "
diff --git a/EzPC/EzPC/codegenporthos.ml b/EzPC/EzPC/codegenporthos.ml
index a384b0e..2fb982c 100644
--- a/EzPC/EzPC/codegenporthos.ml
+++ b/EzPC/EzPC/codegenporthos.ml
@@ -498,6 +498,9 @@ let o_global (g0:gamma) (d:global) :comp * gamma =
 
 let prelude_string :string =
 "\
+/*\n\
+This is an autogenerated file, generated using the EzPC compiler.\n\
+*/\n\
 #include \"globals.h\"\n\
 \n\
 #include<vector>\n\
diff --git a/EzPC/EzPC/docker_test/docker_arith_example.ezpc b/EzPC/EzPC/docker_test/docker_arith_example.ezpc
index 2d615bf..f3a4abc 100644
--- a/EzPC/EzPC/docker_test/docker_arith_example.ezpc
+++ b/EzPC/EzPC/docker_test/docker_arith_example.ezpc
@@ -1,3 +1,27 @@
+(*
+
+Authors: Mayank Rathee, Nishant Kumar, Aseem Rastogi.
+
+Copyright:
+Copyright (c) 2018 Microsoft Research
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+*)
+
 def void main() {
 	uint32_al a = 5u;
 	uint32_al b = 10u;
diff --git a/EzPC/EzPC/docker_test/docker_bin_example.ezpc b/EzPC/EzPC/docker_test/docker_bin_example.ezpc
index 96be7cc..11f6048 100644
--- a/EzPC/EzPC/docker_test/docker_bin_example.ezpc
+++ b/EzPC/EzPC/docker_test/docker_bin_example.ezpc
@@ -1,3 +1,27 @@
+(*
+
+Authors: Mayank Rathee, Nishant Kumar, Aseem Rastogi.
+
+Copyright:
+Copyright (c) 2018 Microsoft Research
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+*)
+
 def void main() {
 	bool_bl e = false;
 	bool_bl f = true;
diff --git a/EzPC/EzPC/test_suite/precompiled_output/binop0.cpp b/EzPC/EzPC/test_suite/precompiled_output/binop0.cpp
index 4991176..f850889 100644
--- a/EzPC/EzPC/test_suite/precompiled_output/binop0.cpp
+++ b/EzPC/EzPC/test_suite/precompiled_output/binop0.cpp
@@ -1,3 +1,6 @@
+/*
+This is an autogenerated file, generated using the EzPC compiler.
+*/
 #include<vector>
 #include<math.h>
 #include<cstdlib>
diff --git a/EzPC/EzPC/test_suite/precompiled_output/decl0.cpp b/EzPC/EzPC/test_suite/precompiled_output/decl0.cpp
index 78fd24d..c558405 100644
--- a/EzPC/EzPC/test_suite/precompiled_output/decl0.cpp
+++ b/EzPC/EzPC/test_suite/precompiled_output/decl0.cpp
@@ -1,3 +1,6 @@
+/*
+This is an autogenerated file, generated using the EzPC compiler.
+*/
 #include<vector>
 #include<math.h>
 #include<cstdlib>
diff --git a/EzPC/EzPC/test_suite/precompiled_output/dot_product0.cpp b/EzPC/EzPC/test_suite/precompiled_output/dot_product0.cpp
index 905ee2a..be0e76a 100644
--- a/EzPC/EzPC/test_suite/precompiled_output/dot_product0.cpp
+++ b/EzPC/EzPC/test_suite/precompiled_output/dot_product0.cpp
@@ -1,3 +1,6 @@
+/*
+This is an autogenerated file, generated using the EzPC compiler.
+*/
 #include<vector>
 #include<math.h>
 #include<cstdlib>
diff --git a/EzPC/EzPC/test_suite/precompiled_output/for0.cpp b/EzPC/EzPC/test_suite/precompiled_output/for0.cpp
index 3c282df..aea51cb 100644
--- a/EzPC/EzPC/test_suite/precompiled_output/for0.cpp
+++ b/EzPC/EzPC/test_suite/precompiled_output/for0.cpp
@@ -1,3 +1,6 @@
+/*
+This is an autogenerated file, generated using the EzPC compiler.
+*/
 #include<vector>
 #include<math.h>
 #include<cstdlib>
diff --git a/EzPC/EzPC/test_suite/precompiled_output/func0.cpp b/EzPC/EzPC/test_suite/precompiled_output/func0.cpp
index 633070b..10a548e 100644
--- a/EzPC/EzPC/test_suite/precompiled_output/func0.cpp
+++ b/EzPC/EzPC/test_suite/precompiled_output/func0.cpp
@@ -1,3 +1,6 @@
+/*
+This is an autogenerated file, generated using the EzPC compiler.
+*/
 #include<vector>
 #include<math.h>
 #include<cstdlib>
diff --git a/EzPC/EzPC/test_suite/precompiled_output/if0.cpp b/EzPC/EzPC/test_suite/precompiled_output/if0.cpp
index ab11a11..db94d29 100644
--- a/EzPC/EzPC/test_suite/precompiled_output/if0.cpp
+++ b/EzPC/EzPC/test_suite/precompiled_output/if0.cpp
@@ -1,3 +1,6 @@
+/*
+This is an autogenerated file, generated using the EzPC compiler.
+*/
 #include<vector>
 #include<math.h>
 #include<cstdlib>
diff --git a/EzPC/EzPC/test_suite/precompiled_output/input0.cpp b/EzPC/EzPC/test_suite/precompiled_output/input0.cpp
index e459aa5..969aea4 100644
--- a/EzPC/EzPC/test_suite/precompiled_output/input0.cpp
+++ b/EzPC/EzPC/test_suite/precompiled_output/input0.cpp
@@ -1,3 +1,6 @@
+/*
+This is an autogenerated file, generated using the EzPC compiler.
+*/
 #include<vector>
 #include<math.h>
 #include<cstdlib>
diff --git a/EzPC/EzPC/test_suite/precompiled_output/output0.cpp b/EzPC/EzPC/test_suite/precompiled_output/output0.cpp
index a14e376..70f8527 100644
--- a/EzPC/EzPC/test_suite/precompiled_output/output0.cpp
+++ b/EzPC/EzPC/test_suite/precompiled_output/output0.cpp
@@ -1,3 +1,6 @@
+/*
+This is an autogenerated file, generated using the EzPC compiler.
+*/
 #include<vector>
 #include<math.h>
 #include<cstdlib>
diff --git a/EzPC/EzPC/test_suite/precompiled_output/while0.cpp b/EzPC/EzPC/test_suite/precompiled_output/while0.cpp
index fb3a68a..1bf85a1 100644
--- a/EzPC/EzPC/test_suite/precompiled_output/while0.cpp
+++ b/EzPC/EzPC/test_suite/precompiled_output/while0.cpp
@@ -1,3 +1,6 @@
+/*
+This is an autogenerated file, generated using the EzPC compiler.
+*/
 #include<vector>
 #include<math.h>
 #include<cstdlib>
-- 
GitLab