chiark / gitweb /
1f0a25492dfc477a1077a0e3a1647cb6f456730f
[chiark-tcl.git] / crypto / crypto.tct
1 # crypto - Tcl bindings for parts of the `nettle' crypto library
2 # Copyright 2006 Ian Jackson
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17 # 02110-1301, USA.
18
19
20 Table *hbcryptotoplevel TopLevel_Command
21         hbcrypto
22                 dispatch(HBCrypto/_SubCommand, "hbcrypto subcommand")
23
24 Table hbcrypto HBCrypto_SubCommand
25         pad
26                 op      enum(PadOp/, "hbcrypto pad subcommand")
27                 v       hbv
28                 blocksz obj
29                 meth    enum(PadMethodInfo/, "pad method")
30                 ...     methargs
31         blockcipher
32                 op      enum(BlockCipherOp/, "op")
33                 ...     obj
34         hash
35                 alg     enum(HashAlgInfo/, "hash alg")
36                 message hb
37                 =>      hb
38         hmac
39                 alg     enum(HashAlgInfo/, "hash alg for hmac")
40                 message hb
41                 key     obj
42                 ?maclen obj
43                 =>      hb
44         hash-prop
45                 prop    enum(HashAlgPropInfo/, "prop")
46                 alg     enum(HashAlgInfo/, "alg")
47                 =>      int
48
49 Table padmethodinfo PadMethodInfo
50         pkcs5
51                 =>      int
52         rfc2406
53                 nxthdr  obj
54                 =>      int
55
56 Table blockcipherop BlockCipherOp
57         e       1
58                 v       hbv
59                 alg     enum(BlockCipherAlgInfo/, "alg")
60                 key     obj
61                 mode    enum(BlockCipherModeInfo/, "mode")
62                 ?iv     hb
63                 =>      hb
64         d       0
65                 v       hbv
66                 alg     enum(BlockCipherAlgInfo/, "alg")
67                 key     obj
68                 mode    enum(BlockCipherModeInfo/, "mode")
69                 ?iv     hb
70                 =>      hb
71         mac     -1
72                 msg     hb
73                 alg     enum(BlockCipherAlgInfo/, "alg")
74                 key     obj
75                 mode    enum(BlockCipherModeInfo/, "mode")
76                 iv      hb
77                 =>      hb
78         prop    -1
79                 prop    enum(BlockCipherPropInfo/, "prop")
80                 alg     enum(BlockCipherAlgInfo/, "alg")
81                 =>      int
82
83 EntryExtra BlockCipherOp
84         int encrypt;