chiark / gitweb /
New blockcipher mac stuff. New hbytes clockincrement.
[chiark-tcl.git] / base / tables-examples.tct
index b5a104b825409384e6a206df5bde3175996ecd46..c130136bc094ba3079aa276d07cd5ce824fb0fb5 100644 (file)
@@ -13,13 +13,45 @@ Type ulong:                 unsigned long @
 
 H-Include      "hbytes.h"
 
-Untabled
+Table toplevel TopLevel_Command
        hbytes
                subcmd  enum(HBytes_SubCommand, "hbytes subcommand")
-               obj     ...
+               ...     obj
        dgram-socket
-               subcmd enum(DgramSocket_SubCommand,"dgram-socket subcommand")
-               obj     ...
+               subcmd  enum(DgramSocket_SubCommand,"dgram-socket subcommand")
+               ...     obj
+       ulong
+               subcmd  enum(ULong_SubCommand,"ulong subcommand")
+               ...     obj
+
+Table ulong ULong_SubCommand
+       shift
+               right   charfrom("lr", "shift direction")
+               v       ulong
+               bits    int
+               =>      ulong
+       mask
+               a       ulong
+               b       ulong
+               =>      ulong
+       compare
+               a       ulong
+               b       ulong
+               =>      int
+       ul2int
+               v       ulong
+               =>      int
+       int2ul
+               v       int
+               =>      ulong
+       ul2bitfields
+               value   ulong
+               ...     obj
+               =>      int
+       bitfields2ul
+               base    ulong
+               ...     obj
+               =>      ulong
 
 Table hbytes HBytes_SubCommand
        raw2h
@@ -54,15 +86,15 @@ Table hbytes HBytes_SubCommand
                =>      hb
        prepend
                v       hbv
-               str     ...
+               ...     str
        append
                v       hbv
-               str     ...
+               ...     str
        rep-info
                v       obj
                =>      obj
        concat
-               str     ...
+               ...     str
                =>      hb
        unprepend
                v       hbv
@@ -76,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
@@ -99,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
@@ -119,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;