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_BLINDING_invert_ex.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_BLINDING_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="#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_BLINDING_new, BN_BLINDING_free, BN_BLINDING_update, BN_BLINDING_convert, BN_BLINDING_invert, BN_BLINDING_convert_ex, BN_BLINDING_invert_ex, BN_BLINDING_is_current_thread, BN_BLINDING_set_current_thread, BN_BLINDING_lock, BN_BLINDING_unlock, BN_BLINDING_get_flags, BN_BLINDING_set_flags, BN_BLINDING_create_param - blinding related BIGNUM functions</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <pre> #include <openssl/bn.h></pre> <pre> BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod); void BN_BLINDING_free(BN_BLINDING *b); int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_is_current_thread(BN_BLINDING *b); void BN_BLINDING_set_current_thread(BN_BLINDING *b); int BN_BLINDING_lock(BN_BLINDING *b); int BN_BLINDING_unlock(BN_BLINDING *b); unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), BN_MONT_CTX *m_ctx);</pre> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p><code>BN_BLINDING_new()</code> allocates a new <strong>BN_BLINDING</strong> structure and copies the <strong>A</strong> and <strong>Ai</strong> values into the newly created <strong>BN_BLINDING</strong> object.</p> <p><code>BN_BLINDING_free()</code> frees the <strong>BN_BLINDING</strong> structure. If <strong>b</strong> is NULL, nothing is done.</p> <p><code>BN_BLINDING_update()</code> updates the <strong>BN_BLINDING</strong> parameters by squaring the <strong>A</strong> and <strong>Ai</strong> or, after specific number of uses and if the necessary parameters are set, by re-creating the blinding parameters.</p> <p><code>BN_BLINDING_convert_ex()</code> multiplies <strong>n</strong> with the blinding factor <strong>A</strong>. If <strong>r</strong> is not NULL a copy the inverse blinding factor <strong>Ai</strong> will be returned in <strong>r</strong> (this is useful if a <strong>RSA</strong> object is shared among several threads). <code>BN_BLINDING_invert_ex()</code> multiplies <strong>n</strong> with the inverse blinding factor <strong>Ai</strong>. If <strong>r</strong> is not NULL it will be used as the inverse blinding.</p> <p><code>BN_BLINDING_convert()</code> and <code>BN_BLINDING_invert()</code> are wrapper functions for <code>BN_BLINDING_convert_ex()</code> and <code>BN_BLINDING_invert_ex()</code> with <strong>r</strong> set to NULL.</p> <p><code>BN_BLINDING_is_current_thread()</code> returns whether the <strong>BN_BLINDING</strong> structure is owned by the current thread. This is to help users provide proper locking if needed for multi-threaded use.</p> <p><code>BN_BLINDING_set_current_thread()</code> sets the current thread as the owner of the <strong>BN_BLINDING</strong> structure.</p> <p><code>BN_BLINDING_lock()</code> locks the <strong>BN_BLINDING</strong> structure.</p> <p><code>BN_BLINDING_unlock()</code> unlocks the <strong>BN_BLINDING</strong> structure.</p> <p><code>BN_BLINDING_get_flags()</code> returns the BN_BLINDING flags. Currently there are two supported flags: <strong>BN_BLINDING_NO_UPDATE</strong> and <strong>BN_BLINDING_NO_RECREATE</strong>. <strong>BN_BLINDING_NO_UPDATE</strong> inhibits the automatic update of the <strong>BN_BLINDING</strong> parameters after each use and <strong>BN_BLINDING_NO_RECREATE</strong> inhibits the automatic re-creation of the <strong>BN_BLINDING</strong> parameters after a fixed number of uses (currently 32). In newly allocated <strong>BN_BLINDING</strong> objects no flags are set. <code>BN_BLINDING_set_flags()</code> sets the <strong>BN_BLINDING</strong> parameters flags.</p> <p><code>BN_BLINDING_create_param()</code> creates new <strong>BN_BLINDING</strong> parameters using the exponent <strong>e</strong> and the modulus <strong>m</strong>. <strong>bn_mod_exp</strong> and <strong>m_ctx</strong> can be used to pass special functions for exponentiation (normally <code>BN_mod_exp_mont()</code> and <strong>BN_MONT_CTX</strong>).</p> <p> </p> <hr /> <h1><a name="return_values">RETURN VALUES</a></h1> <p><code>BN_BLINDING_new()</code> returns the newly allocated <strong>BN_BLINDING</strong> structure or NULL in case of an error.</p> <p><code>BN_BLINDING_update()</code>, <code>BN_BLINDING_convert()</code>, <code>BN_BLINDING_invert()</code>, <code>BN_BLINDING_convert_ex()</code> and <code>BN_BLINDING_invert_ex()</code> return 1 on success and 0 if an error occurred.</p> <p><code>BN_BLINDING_is_current_thread()</code> returns 1 if the current thread owns the <strong>BN_BLINDING</strong> object, 0 otherwise.</p> <p><code>BN_BLINDING_set_current_thread()</code> doesn't return anything.</p> <p><code>BN_BLINDING_lock()</code>, <code>BN_BLINDING_unlock()</code> return 1 if the operation succeeded or 0 on error.</p> <p><code>BN_BLINDING_get_flags()</code> returns the currently set <strong>BN_BLINDING</strong> flags (a <strong>unsigned long</strong> value).</p> <p><code>BN_BLINDING_create_param()</code> returns the newly created <strong>BN_BLINDING</strong> parameters or NULL on error.</p> <p> </p> <hr /> <h1><a name="history">HISTORY</a></h1> <p><code>BN_BLINDING_thread_id()</code> was first introduced in OpenSSL 1.0.0, and it deprecates <code>BN_BLINDING_set_thread_id()</code> and <code>BN_BLINDING_get_thread_id()</code>.</p> <p> </p> <hr /> <h1><a name="copyright">COPYRIGHT</a></h1> <p>Copyright 2005-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>