chiark / gitweb /
New blockcipher mac stuff. New hbytes clockincrement.
[chiark-tcl.git] / base / tables-examples.tct
index f0f22354400958e7102e1ea56c99ec33c7a1d13b..c130136bc094ba3079aa276d07cd5ce824fb0fb5 100644 (file)
@@ -108,19 +108,34 @@ Table hbytes HBytes_SubCommand
                v       hbv
                length  int
                =>      hb
+       overwrite
+               v       hbv
+               start   int
+               sub     hb
+       trimleft
+               v       hbv
+       zeroes
+               length  int
+               =>      hb
+       repeat
+               v       hb
+               count   int
+               =>      hb
+       clockincrement
+               value   hbv
+               change  int
+               =>      int
+       random
+               length  int
+               =>      hb
        pkcs5
                meth    enum(PadMethod, "hbytes pad subcommand")
                v       hbv
                block   obj
                =>      int
        blockcipher
-               encrypt charfrom("de","encrypt/decrypt")
-               v       hbv
-               alg     enum(BlockCipherAlgInfo, "alg")
-               key     obj
-               mode    enum(BlockCipherModeInfo, "mode")
-               ?iv     hb
-               =>      hb
+               op      enum(BlockCipherOp, "op")
+               ...     obj
        hash
                alg     enum(HashAlgInfo, "hash alg")
                message hb
@@ -131,12 +146,6 @@ Table hbytes HBytes_SubCommand
                key     obj
                ?maclen obj
                =>      hb
-       zeroes
-               length  int
-               =>      hb
-       random
-               length  int
-               =>      hb
 
 Table dgram_socket DgramSocket_SubCommand
        create
@@ -151,3 +160,29 @@ Table dgram_socket DgramSocket_SubCommand
        on-receive
                sock    sockid
                ?script obj
+
+Table blockcipherop BlockCipherOp
+       e       1
+               v       hbv
+               alg     enum(BlockCipherAlgInfo, "alg")
+               key     obj
+               mode    enum(BlockCipherModeInfo, "mode")
+               ?iv     hb
+               =>      hb
+       d       0
+               v       hbv
+               alg     enum(BlockCipherAlgInfo, "alg")
+               key     obj
+               mode    enum(BlockCipherModeInfo, "mode")
+               ?iv     hb
+               =>      hb
+       mac     -1
+               msg     hb
+               alg     enum(BlockCipherAlgInfo, "alg")
+               key     obj
+               mode    enum(BlockCipherModeInfo, "mode")
+               iv      hb
+               =>      hb
+
+EntryExtra BlockCipherOp
+       int encrypt;