chiark / gitweb /
New blockcipher mac stuff. New hbytes clockincrement.
[chiark-tcl.git] / base / tables-examples.tct
1 Type hb:                        HBytes_Value @
2 Init hb                         hbytes_sentinel(&@);
3
4 Type hbv:                       HBytes_Var @
5 Init hbv                        @.hb=0; @.obj=0; @.var=0;
6 Fini hbv                        fini_hbv(ip, rc, &@);
7
8 Type sockaddr:                  SockAddr_Value @
9 Init sockaddr                   sockaddr_clear(&@);
10
11 Type sockid:                    DgramSockID @
12 Type ulong:                     unsigned long @
13
14 H-Include       "hbytes.h"
15
16 Table toplevel TopLevel_Command
17         hbytes
18                 subcmd  enum(HBytes_SubCommand, "hbytes subcommand")
19                 ...     obj
20         dgram-socket
21                 subcmd  enum(DgramSocket_SubCommand,"dgram-socket subcommand")
22                 ...     obj
23         ulong
24                 subcmd  enum(ULong_SubCommand,"ulong subcommand")
25                 ...     obj
26
27 Table ulong ULong_SubCommand
28         shift
29                 right   charfrom("lr", "shift direction")
30                 v       ulong
31                 bits    int
32                 =>      ulong
33         mask
34                 a       ulong
35                 b       ulong
36                 =>      ulong
37         compare
38                 a       ulong
39                 b       ulong
40                 =>      int
41         ul2int
42                 v       ulong
43                 =>      int
44         int2ul
45                 v       int
46                 =>      ulong
47         ul2bitfields
48                 value   ulong
49                 ...     obj
50                 =>      int
51         bitfields2ul
52                 base    ulong
53                 ...     obj
54                 =>      ulong
55
56 Table hbytes HBytes_SubCommand
57         raw2h
58                 binary  obj
59                 =>      hb
60         h2raw
61                 hex     hb
62                 =>      obj
63         ulong2h
64                 value   ulong
65                 =>      hb
66         h2ulong
67                 hex     hb
68                 =>      ulong
69         ushort2h
70                 value   ulong
71                 =>      hb
72         h2ushort
73                 hex     hb
74                 =>      ulong
75         length
76                 v       hb
77                 =>      int
78         compare
79                 a       hb
80                 b       hb
81                 =>      int
82         range
83                 v       hb
84                 start   int
85                 size    int
86                 =>      hb
87         prepend
88                 v       hbv
89                 ...     str
90         append
91                 v       hbv
92                 ...     str
93         rep-info
94                 v       obj
95                 =>      obj
96         concat
97                 ...     str
98                 =>      hb
99         unprepend
100                 v       hbv
101                 length  int
102                 =>      hb
103         unappend
104                 v       hbv
105                 length  int
106                 =>      hb
107         chopto
108                 v       hbv
109                 length  int
110                 =>      hb
111         overwrite
112                 v       hbv
113                 start   int
114                 sub     hb
115         trimleft
116                 v       hbv
117         zeroes
118                 length  int
119                 =>      hb
120         repeat
121                 v       hb
122                 count   int
123                 =>      hb
124         clockincrement
125                 value   hbv
126                 change  int
127                 =>      int
128         random
129                 length  int
130                 =>      hb
131         pkcs5
132                 meth    enum(PadMethod, "hbytes pad subcommand")
133                 v       hbv
134                 block   obj
135                 =>      int
136         blockcipher
137                 op      enum(BlockCipherOp, "op")
138                 ...     obj
139         hash
140                 alg     enum(HashAlgInfo, "hash alg")
141                 message hb
142                 =>      hb
143         hmac
144                 alg     enum(HashAlgInfo, "hash alg for hmac")
145                 message hb
146                 key     obj
147                 ?maclen obj
148                 =>      hb
149
150 Table dgram_socket DgramSocket_SubCommand
151         create
152                 local   sockaddr
153                 =>      sockid
154         close
155                 sock    sockid
156         transmit
157                 sock    sockid
158                 data    hb
159                 remote  sockaddr
160         on-receive
161                 sock    sockid
162                 ?script obj
163
164 Table blockcipherop BlockCipherOp
165         e       1
166                 v       hbv
167                 alg     enum(BlockCipherAlgInfo, "alg")
168                 key     obj
169                 mode    enum(BlockCipherModeInfo, "mode")
170                 ?iv     hb
171                 =>      hb
172         d       0
173                 v       hbv
174                 alg     enum(BlockCipherAlgInfo, "alg")
175                 key     obj
176                 mode    enum(BlockCipherModeInfo, "mode")
177                 ?iv     hb
178                 =>      hb
179         mac     -1
180                 msg     hb
181                 alg     enum(BlockCipherAlgInfo, "alg")
182                 key     obj
183                 mode    enum(BlockCipherModeInfo, "mode")
184                 iv      hb
185                 =>      hb
186
187 EntryExtra BlockCipherOp
188         int encrypt;