Index: doc/tls.html ================================================================== --- doc/tls.html +++ doc/tls.html @@ -36,10 +36,12 @@
tls::macs
tls::protocols
tls::version
 
tls::digest type ?options?
+
tls::cmac type -cipher name ?options?
+
tls::hmac type -key key ?options?
tls::md4 data
tls::md5 data
tls::sha1 data
tls::sha256 data
tls::sha512 data
@@ -78,10 +80,12 @@ tls::macs
tls::protocols
tls::version

tls::digest type ?options?
+tls::cmac type -cipher name ?options?
+tls::hmac type -key key ?options?
tls::md4 data
tls::md5 data
tls::sha1 data
tls::sha256 data
tls::sha512 data
@@ -458,31 +462,52 @@
tls::version
Returns the OpenSSL version string.

-
tls::digest type ?-bin|-hex? - ?-key hmac_key? [-file filename | -command cmdName | -chan channelId | ?-data? data]
-
Calculate the message digest for data or file filename - using type hash algorithm. Returns value as a hex string - (default) or as a binary value with -bin option. Use -key to - set the key and return a Hashed Message Authentication Code (HMAC). - To salt a password, append or prepend the salt data to the password. - Argument type can be any OpenSSL supported hash algorithm including: - md4, md5, sha1, sha256, sha512, - sha3-256, etc. See tls::digests command for a full list. +
tls::digest digest ?-bin|-hex? + [-file filename | -command cmdName | -chan channelId | ?-data? data]
+
Calculate the message digest for data using digest hash + function. Returns value as a hex string (default) or as a binary value + with -bin option. Argument digest can be any OpenSSL + supported hash function including: md4, md5, sha1, + sha256, sha512, sha3-256, etc. See + tls::digests command for a full list. +
+ Using the -data option will immediately return the message + digest for data in the specified format. +
+ Using the -file option will open file filename, read + the file data, close the file, and return the message digest in the + specified format. This uses the TCL APIs, so VFS files are supported.
- Using the -chan option, a stacked channel is created and data - read from the channel is used to calculate a message digest with the - result returned with the last read operation before EOF. + Using the -chan option, a stacked channel is created for + channelId and data read from the channel is used to calculate + a message digest with the result returned with the last read operation + before EOF. Channel is automatically set to binary mode.
Using the -command option, a new command cmdName is - created and returned. To add data to the hash, call "cmdName - update data", where data is the data to add. When done, - call "cmdName finalize" to return the - message digest. + created and returned. To add data to the hash function, call + "cmdName update data", where data is + the data to add. When done, call "cmdName finalize" + to return the message digest.
+ +
tls::cmac digest + -cipher name ?-bin|-hex? [-file filename | + -command cmdName | -chan channelId | ?-data? data]
+
Calculate the Cipher-based Message Authentication Code (CMAC). Same arguments + as tls::digest with additional option -cipher to specify the + cipher to use and for certain ciphers, -key to specify the key.
+ +
tls::hmac digest + -key key ?-bin|-hex? [-file filename | + -command cmdName | -chan channelId | ?-data? data]
+
Calculate the Hashed Message Authentication Code (HMAC). Same arguments + as tls::digest with additional option -key to specify the + key to use. To salt a password, append or prepend the salt + data to the password.
tls::md4 data
Returns the MD4 message-digest for data as a hex string.
tls::md5 data