chiark / gitweb /
Honour dpkg-architecture's DEB_HOST_GNU_TYPE, to fix cross-building.
[chiark-tcl.git] / crypto / crypto.tct
1 # crypto - Tcl bindings for parts of the `nettle' crypto library
2 # Copyright 2006-2012 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, see <http://www.gnu.org/licenses/>.
16
17
18 Table *hbcryptotoplevel TopLevel_Command
19         hbcrypto
20                 dispatch(HBCrypto/_SubCommand, "hbcrypto subcommand")
21
22 Table hbcrypto HBCrypto_SubCommand
23         pad
24                 op      enum(PadOp/, "hbcrypto pad subcommand")
25                 v       hbv
26                 blocksz obj
27                 meth    enum(PadMethodInfo/, "pad method")
28                 ...     methargs
29         blockcipher
30                 op      enum(BlockCipherOp/, "op")
31                 ...     obj
32         hash
33                 alg     enum(HashAlgInfo/, "hash alg")
34                 message hb
35                 =>      hb
36         hash-init
37                 alg     enum(HashAlgInfo/, "hash alg")
38                 =>      iddata(&cht_hash_states)
39         hash-update
40                 stateh  iddata(&cht_hash_states)
41                 message hb
42         hash-final
43                 stateh  iddata(&cht_hash_states)
44                 =>      hb
45         hash-discard
46                 stateh  iddata(&cht_hash_states)
47         hash-clonestate
48                 stateh  iddata(&cht_hash_states)
49                 =>      iddata(&cht_hash_states)
50         hmac
51                 alg     enum(HashAlgInfo/, "hash alg for hmac")
52                 message hb
53                 key     obj
54                 ?maclen obj
55                 =>      hb
56         hash-prop
57                 prop    enum(HashAlgPropInfo/, "prop")
58                 alg     enum(HashAlgInfo/, "alg")
59                 =>      int
60
61 Table padmethodinfo PadMethodInfo
62         pkcs5
63                 =>      int
64         rfc2406
65                 nxthdr  obj
66                 =>      int
67
68 Table blockcipherop BlockCipherOp
69         e       1
70                 v       hbv
71                 alg     enum(BlockCipherAlgInfo/, "alg")
72                 key     obj
73                 mode    enum(BlockCipherModeInfo/, "mode")
74                 ?iv     hb
75                 =>      hb
76         d       0
77                 v       hbv
78                 alg     enum(BlockCipherAlgInfo/, "alg")
79                 key     obj
80                 mode    enum(BlockCipherModeInfo/, "mode")
81                 ?iv     hb
82                 =>      hb
83         mac     -1
84                 msg     hb
85                 alg     enum(BlockCipherAlgInfo/, "alg")
86                 key     obj
87                 mode    enum(BlockCipherModeInfo/, "mode")
88                 iv      hb
89                 =>      hb
90         prop    -1
91                 prop    enum(BlockCipherPropInfo/, "prop")
92                 alg     enum(BlockCipherAlgInfo/, "alg")
93                 =>      int
94
95 EntryExtra BlockCipherOp
96         int encrypt;