Current Path : /usr/opt/openssl11/share/doc/openssl/html/man3/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/openssl11/share/doc/openssl/html/man3/BN_CTX_secure_new.html |
<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>BN_CTX_new</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:root@hsxx.drive.ne.jp" /> </head> <body style="background-color: white"> <!-- INDEX BEGIN --> <div name="index"> <p><a name="__index__"></a></p> <ul> <li><a href="#name">NAME</a></li> <li><a href="#synopsis">SYNOPSIS</a></li> <li><a href="#description">DESCRIPTION</a></li> <li><a href="#return_values">RETURN VALUES</a></li> <li><a href="#removed_functionality">REMOVED FUNCTIONALITY</a></li> <li><a href="#see_also">SEE ALSO</a></li> <li><a href="#history">HISTORY</a></li> <li><a href="#copyright">COPYRIGHT</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <hr /> <h1><a name="name">NAME</a></h1> <p>BN_CTX_new, BN_CTX_secure_new, BN_CTX_free - allocate and free BN_CTX structures</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> #include <openssl/bn.h></pre> <pre> BN_CTX *BN_CTX_new(void);</pre> <pre> BN_CTX *BN_CTX_secure_new(void);</pre> <pre> void BN_CTX_free(BN_CTX *c);</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>A <strong>BN_CTX</strong> is a structure that holds <strong>BIGNUM</strong> temporary variables used by library functions. Since dynamic memory allocation to create <strong>BIGNUM</strong>s is rather expensive when used in conjunction with repeated subroutine calls, the <strong>BN_CTX</strong> structure is used.</p> <p><code>BN_CTX_new()</code> allocates and initializes a <strong>BN_CTX</strong> structure. <code>BN_CTX_secure_new()</code> allocates and initializes a <strong>BN_CTX</strong> structure but uses the secure heap (see <em>CRYPTO_secure_malloc(3)</em>) to hold the <strong>BIGNUM</strong>s.</p> <p><code>BN_CTX_free()</code> frees the components of the <strong>BN_CTX</strong> and the structure itself. Since <code>BN_CTX_start()</code> is required in order to obtain <strong>BIGNUM</strong>s from the <strong>BN_CTX</strong>, in most cases <code>BN_CTX_end()</code> must be called before the <strong>BN_CTX</strong> may be freed by <code>BN_CTX_free()</code>. If <strong>c</strong> is NULL, nothing is done.</p> <p>A given <strong>BN_CTX</strong> must only be used by a single thread of execution. No locking is performed, and the internal pool allocator will not properly handle multiple threads of execution.</p> <p> </p> <hr /> <h1><a name="return_values">RETURN VALUES</a></h1> <p><code>BN_CTX_new()</code> and <code>BN_CTX_secure_new()</code> return a pointer to the <strong>BN_CTX</strong>. If the allocation fails, they return <strong>NULL</strong> and sets an error code that can be obtained by <em>ERR_get_error(3)</em>.</p> <p><code>BN_CTX_free()</code> has no return values.</p> <p> </p> <hr /> <h1><a name="removed_functionality">REMOVED FUNCTIONALITY</a></h1> <pre> void BN_CTX_init(BN_CTX *c);</pre> <p><code>BN_CTX_init()</code> is no longer available as of OpenSSL 1.1.0. Applications should replace use of BN_CTX_init with BN_CTX_new instead:</p> <pre> BN_CTX *ctx; ctx = BN_CTX_new(); if (!ctx) /* error */ ... BN_CTX_free(ctx);</pre> <p> </p> <hr /> <h1><a name="see_also">SEE ALSO</a></h1> <p><em>ERR_get_error(3)</em>, <em>BN_add(3)</em>, <em>BN_CTX_start(3)</em></p> <p> </p> <hr /> <h1><a name="history">HISTORY</a></h1> <p><code>BN_CTX_init()</code> was removed in OpenSSL 1.1.0.</p> <p> </p> <hr /> <h1><a name="copyright">COPYRIGHT</a></h1> <p>Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved.</p> <p>Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p> </body> </html>