chiark / gitweb /
mon/tripemon.in (CryptoInfo): Use the `cryptolayout' table to populate.
[tripe] / mon / tripemon.in
index 0404e21e48efcf20cf2458b63429bdfb46bd1b33..d96601fbf56c9bb37e3a7c945afed4ed05d1f1d3 100644 (file)
@@ -1423,31 +1423,11 @@ class CryptoInfo (TrivialWindow):
     me.add(table)
 
     crypto = conn.algs()
-    table.info('Diffie-Hellman group',
-               '%s (%d-bit order, %d-bit elements)' %
-               (crypto['kx-group'],
-                int(crypto['kx-group-order-bits']),
-                int(crypto['kx-group-elt-bits'])),
-               len = 42)
-    table.info('Data encryption',
-               '%s (%d-bit key; %s)' %
-               (crypto['cipher'],
-                int(crypto['cipher-keysz']) * 8,
-                crypto['cipher-blksz'] == '0'
-                  and 'stream cipher'
-                  or '%d-bit block' % (int(crypto['cipher-blksz']) * 8)),
-               newlinep = True)
-    table.info('Message authentication',
-               '%s (%d-bit key; %d-bit tag)' %
-               (crypto['mac'],
-                int(crypto['mac-keysz']) * 8,
-                int(crypto['mac-tagsz']) * 8),
-               newlinep = True)
-    table.info('Hash function',
-               '%s (%d-bit output)' %
-               (crypto['hash'],
-                int(crypto['hash-sz']) * 8),
-               newlinep = True)
+    firstp = True
+    for label, format in cryptolayout:
+      table.info(label, format_stat(format, crypto),
+                 len = 42, newlinep = not firstp)
+      firstp = False
 
     me.show_all()