aboutsummaryrefslogtreecommitdiffhomepage
path: root/presentation/js/main.js
diff options
context:
space:
mode:
authorMarvin Borner2019-06-23 12:42:22 +0200
committerMarvin Borner2019-06-23 12:42:22 +0200
commit0740711fdeadb4765a2e1f495ed85b4846ef926f (patch)
treeb320803d4dec601c359bcabf82e0c8bfae8c8d7e /presentation/js/main.js
parentce9c06fd5e41f77df6e0dbcc553e2ca290e20207 (diff)
Began presentation
Diffstat (limited to 'presentation/js/main.js')
-rw-r--r--presentation/js/main.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/presentation/js/main.js b/presentation/js/main.js
new file mode 100644
index 0000000..829b031
--- /dev/null
+++ b/presentation/js/main.js
@@ -0,0 +1,35 @@
+let currentTable = 0;
+
+function createTable(selector, hex) {
+ let parent = document.getElementById(selector);
+ let decription = document.querySelector("#" + selector + " small");
+ let matrix = decription.textContent;
+ let table = document.getElementsByClassName("tableTemplate")[0].cloneNode(true);
+ let delimiter = hex ? " " : "";
+
+ table.setAttribute("id", "table" + currentTable);
+ parent.insertBefore(table, decription);
+ for (let i = 0; i < 16; i++) {
+ document.querySelector("#table" + currentTable + " [data-id='" + i.toString() + "']")
+ .innerText = matrix.split(delimiter)[i] !== undefined ? matrix.split(delimiter)[i] : "01"
+ }
+ currentTable++;
+}
+
+createTable("AES_1");
+createTable("AES_2");
+createTable("AES_3", true);
+createTable("AES_4", true);
+createTable("AES_5", true);
+createTable("AES_6");
+createTable("AES_7", true);
+createTable("AES_8", true);
+createTable("AES_9", true);
+createTable("AES_10", true);
+createTable("AES_11", true);
+createTable("AES_12", true);
+createTable("AES_13", true);
+createTable("AES_14", true);
+createTable("AES_15", true);
+createTable("AES_16", true);
+createTable("AES_17", true);