-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathankh.tcl
98 lines (72 loc) · 2.23 KB
/
ankh.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# -*- tcl -*-
# Ankh - ANdreas Kupries Hashes
#
# (c) 2021,2924 Andreas Kupries http://wiki.tcl.tk/andreas%20kupries
#
# # ## ### ##### ######## #############
## Requisites
package require critcl 3.1 ;# 3.1 : critcl::source
# ;# 3.0.8 : critcl::at::*
# # ## ### ##### ######## #############
## Bail early if the environment is not suitable.
if {![critcl::compiling]} {
error "Unable to build aktive, no proper compiler found."
}
# # ## ### ##### ######## #############
## Introspection, Version
package provide ankh 1.1
critcl::cconst ::ak::hash::version char* {"1.1"}
# See also
# - tests/version.test
# - doc/include/version.inc
# # ## ### ##### ######## #############
## Administrivia
critcl::license \
{Andreas Kupries} \
{Under a BSD license.}
critcl::summary \
{Commands for using a variety of cryptographically secure hash functions}
critcl::description {
This package provides a number of commands giving access to a
variety of cryptographically secure hash functions, old and new.
}
critcl::subject hash {cryptographically secure hash} {secure hash}
critcl::subject md4 md5 sha1 sha2 sha3 haval ripemd
# # ## ### ##### ######## #############
## Implementation.
## critcl::tcl --- 8.6 or 9, dependent on `package provide Tcl`.
#::critcl::debug symbols memory
#::critcl::config trace on
#::critcl::config lines off
package require critcl::cutil
critcl::cutil::assertions off
critcl::cutil::tracer off
critcl::cutil::alloc
critcl::ccode {
TRACE_OFF;
}
# # ## ### ##### ######## #############
## C side - Support code implementing the hashes
critcl::source hashes.tcl
# # ## ### ##### ######## #############
## C/Tcl glue - Command implementations
critcl::source options.tcl
critcl::source glue.tcl
# # ## ### ##### ######## #############
## Tcl side - Command aggregation into the public API
critcl::tsources policy.tcl
# # ## ### ##### ######## #############
## Make the C pieces ready. Immediate build of the binaries, no deferal.
if {![critcl::load]} {
error "Building and loading aktive failed."
}
# # ## ### ##### ######## #############
return
# - -- --- ----- -------- -------------
# vim: set sts=4 sw=4 tw=80 et ft=tcl:
#
# Local Variables:
# mode: tcl
# fill-column: 78
# End:
#