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
|
<h4 class="subsection">GnuTLS Cryptographic Functions</h4> <dl> <dt id="gnutls-digests">Function: <strong>gnutls-digests</strong>
</dt> <dd>
<p>This function returns the alist of the GnuTLS digest algorithms. </p> <p>Each entry has a key which represents the algorithm, followed by a plist with internal details about the algorithm. The plist will have <code>:type gnutls-digest-algorithm</code> and also will have the key <code>:digest-algorithm-length 64</code> to indicate the size, in bytes, of the resulting digest. </p> <p>There is a name parallel between GnuTLS MAC and digest algorithms but they are separate things internally and should not be mixed. </p>
</dd>
</dl> <dl> <dt id="gnutls-hash-digest">Function: <strong>gnutls-hash-digest</strong> <em>digest-method input</em>
</dt> <dd>
<p>The <var>digest-method</var> can be the whole plist from <code>gnutls-digests</code>, or just the symbol key, or a string with the name of that symbol. </p> <p>The <var>input</var> can be specified as a buffer or string or in other ways (see <a href="format-of-gnutls-cryptography-inputs">Format of GnuTLS Cryptography Inputs</a>). </p> <p>This function returns <code>nil</code> on error, and signals a Lisp error if the <var>digest-method</var> or <var>input</var> are invalid. On success, it returns a list of a binary string (the output) and the IV used. </p>
</dd>
</dl> <dl> <dt id="gnutls-macs">Function: <strong>gnutls-macs</strong>
</dt> <dd>
<p>This function returns the alist of the GnuTLS MAC algorithms. </p> <p>Each entry has a key which represents the algorithm, followed by a plist with internal details about the algorithm. The plist will have <code>:type gnutls-mac-algorithm</code> and also will have the keys <code>:mac-algorithm-length</code> <code>:mac-algorithm-keysize</code> <code>:mac-algorithm-noncesize</code> to indicate the size, in bytes, of the resulting hash, the key, and the nonce respectively. </p> <p>The nonce is currently unused and only some MACs support it. </p> <p>There is a name parallel between GnuTLS MAC and digest algorithms but they are separate things internally and should not be mixed. </p>
</dd>
</dl> <dl> <dt id="gnutls-hash-mac">Function: <strong>gnutls-hash-mac</strong> <em>hash-method key input</em>
</dt> <dd>
<p>The <var>hash-method</var> can be the whole plist from <code>gnutls-macs</code>, or just the symbol key, or a string with the name of that symbol. </p> <p>The <var>key</var> can be specified as a buffer or string or in other ways (see <a href="format-of-gnutls-cryptography-inputs">Format of GnuTLS Cryptography Inputs</a>). The <var>key</var> will be wiped after use if it’s a string. </p> <p>The <var>input</var> can be specified as a buffer or string or in other ways (see <a href="format-of-gnutls-cryptography-inputs">Format of GnuTLS Cryptography Inputs</a>). </p> <p>This function returns <code>nil</code> on error, and signals a Lisp error if the <var>hash-method</var> or <var>key</var> or <var>input</var> are invalid. </p> <p>On success, it returns a list of a binary string (the output) and the IV used. </p>
</dd>
</dl> <dl> <dt id="gnutls-ciphers">Function: <strong>gnutls-ciphers</strong>
</dt> <dd>
<p>This function returns the alist of the GnuTLS ciphers. </p> <p>Each entry has a key which represents the cipher, followed by a plist with internal details about the algorithm. The plist will have <code>:type gnutls-symmetric-cipher</code> and also will have the keys <code>:cipher-aead-capable</code> set to <code>nil</code> or <code>t</code> to indicate AEAD capability; and <code>:cipher-tagsize</code> <code>:cipher-blocksize</code> <code>:cipher-keysize</code> <code>:cipher-ivsize</code> to indicate the size, in bytes, of the tag, block size of the resulting data, the key, and the IV respectively. </p>
</dd>
</dl> <dl> <dt id="gnutls-symmetric-encrypt">Function: <strong>gnutls-symmetric-encrypt</strong> <em>cipher key iv input &optional aead_auth</em>
</dt> <dd>
<p>The <var>cipher</var> can be the whole plist from <code>gnutls-ciphers</code>, or just the symbol key, or a string with the name of that symbol. </p> <p>The <var>key</var> can be specified as a buffer or string or in other ways (see <a href="format-of-gnutls-cryptography-inputs">Format of GnuTLS Cryptography Inputs</a>). The <var>key</var> will be wiped after use if it’s a string. </p> <p>The <var>iv</var> and <var>input</var> and the optional <var>aead_auth</var> can be specified as a buffer or string or in other ways (see <a href="format-of-gnutls-cryptography-inputs">Format of GnuTLS Cryptography Inputs</a>). </p> <p><var>aead_auth</var> is only checked with AEAD ciphers, that is, ciphers whose plist has <code>:cipher-aead-capable t</code>. Otherwise it’s ignored. </p> <p>This function returns <code>nil</code> on error, and signals a Lisp error if the <var>cipher</var> or <var>key</var>, <var>iv</var>, or <var>input</var> are invalid, or if <var>aead_auth</var> was specified with an AEAD cipher and was invalid. </p> <p>On success, it returns a list of a binary string (the output) and the IV used. </p>
</dd>
</dl> <dl> <dt id="gnutls-symmetric-decrypt">Function: <strong>gnutls-symmetric-decrypt</strong> <em>cipher key iv input &optional aead_auth</em>
</dt> <dd>
<p>The <var>cipher</var> can be the whole plist from <code>gnutls-ciphers</code>, or just the symbol key, or a string with the name of that symbol. </p> <p>The <var>key</var> can be specified as a buffer or string or in other ways (see <a href="format-of-gnutls-cryptography-inputs">Format of GnuTLS Cryptography Inputs</a>). The <var>key</var> will be wiped after use if it’s a string. </p> <p>The <var>iv</var> and <var>input</var> and the optional <var>aead_auth</var> can be specified as a buffer or string or in other ways (see <a href="format-of-gnutls-cryptography-inputs">Format of GnuTLS Cryptography Inputs</a>). </p> <p><var>aead_auth</var> is only checked with AEAD ciphers, that is, ciphers whose plist has <code>:cipher-aead-capable t</code>. Otherwise it’s ignored. </p> <p>This function returns <code>nil</code> on decryption error, and signals a Lisp error if the <var>cipher</var> or <var>key</var>, <var>iv</var>, or <var>input</var> are invalid, or if <var>aead_auth</var> was specified with an AEAD cipher and was invalid. </p> <p>On success, it returns a list of a binary string (the output) and the IV used. </p>
</dd>
</dl><div class="_attribution">
<p class="_attribution-p">
Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/GnuTLS-Cryptographic-Functions.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/GnuTLS-Cryptographic-Functions.html</a>
</p>
</div>
|