chiark / gitweb /
server/bulkcrypto.c: Implement a bulk transform based on AEAD schemes.
[tripe] / wireshark / tripe.lua
index 5c6d7ba94ee54ce02a073b7fca49a68f41541359..a3544e9da3797db07705d43c0b6592c17c244e3d 100644 (file)
@@ -57,7 +57,7 @@ local CONFIG = {
   -- order.
 
   { var = "bulk", name = "Bulk transform",
-    type = "enum", allowed = { "v0", "iiv", "naclbox" },
+    type = "enum", allowed = { "v0", "iiv", "naclbox", "aead" },
     descr = "Bulk cryptographic transform", default = "v0" },
   { var = "hashsz", name = "Hash length", type = "int", min = 0,
     descr = "Hash length (bytes)", default = 20 },
@@ -184,6 +184,11 @@ end
 
 -- Dissect a ciphertext of some particular kind.
 local dissect_ct = { }
+function dissect_ct.aead(buf, tree, pos, sz)
+  tree:add(PF["tripe.ciphertext.tag"], buf(pos, C.tagsz)); pos = pos + C.tagsz
+  tree:add(PF["tripe.ciphertext.seq"], buf(pos, 4)); pos = pos + 4
+  tree:add(PF["tripe.ciphertext.body"], buf(pos, sz - pos))
+end
 function dissect_ct.naclbox(buf, tree, pos, sz)
   tree:add(PF["tripe.ciphertext.tag"], buf(pos, 16)); pos = pos + 16
   tree:add(PF["tripe.ciphertext.seq"], buf(pos, 4)); pos = pos + 4