- ('Cipher',
- '%(cipher)s (%(cipher-keysz)s-bit key, %(cipher-blksz)s-bit block)'),
- ('Mac', '%(mac)s (%(mac-keysz)s-bit key, %(mac-tagsz)s-bit tag)'),
- ('Hash', '%(hash)s (%(hash-sz)s-bit output)'),
- ('Last key-exchange', '%(last-keyexch-time)s'),
+ ('Bulk crypto transform',
+ '%(bulk-transform)s (%(bulk-overhead)s byte overhead)'),
+ ('Data encryption', lambda d: '%s (%s; %s)' % (
+ d['cipher'],
+ '%d-bit key' % (8*int(d['cipher-keysz'])),
+ d.get('cipher-blksz', '0') == '0'
+ and 'stream cipher'
+ or '%d-bit block' % (8*int(d['cipher-blksz'])))),
+ ('Message authentication', lambda d: '%s (%s; %s)' % (
+ d['mac'],
+ d.get('mac-keysz') is None
+ and 'one-time MAC'
+ or '%d-bit key' % (8*int(d['mac-keysz'])),
+ '%d-bit tag' % (8*int(d['mac-tagsz'])))),
+ ('Hash', lambda d: '%s (%d-bit output)' %
+ (d['hash'], 8*int(d['hash-sz'])))]
+
+statslayout = \
+ [('Start time', '%(start-time)s'),
+ ('Private key', '%(current-key)s')] + \
+ cryptolayout + \
+ [('Last key-exchange', '%(last-keyexch-time)s'),