BN_BLINDING_NEW(3ossl)
πΈ NAME πΈ
okay so bestie, this is the BN_BLINDING girlies π
β a whole squad of blinding-related BIGNUM functions that live in the OpenSSL manual, section 3ossl (yes that's the manual name, we're fancy here β¨).
Meet the cast π:
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
β¨ SYNOPSIS β¨
like literally just include the header and you're in, no cap π«Ά
#include <openssl/bn.h>
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 *b);
void BN_BLINDING_set_flags(BN_BLINDING *b, unsigned long flags);
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);
π DESCRIPTION π
BN_BLINDING_new()β makes you a brand newBN_BLINDINGstructure and copies theAandAivalues right into that freshly createdBN_BLINDINGobject. it's giving newborn energy πΌβ¨BN_BLINDING_free()β frees theBN_BLINDINGstructure. and ifbisNULL? literally nothing happens, it just vibes. no crash, no drama πBN_BLINDING_update()β updates theBN_BLINDINGparameters by squaring theAandAi, or β after a specific number of uses and if the necessary parameters are set β by re-creating the blinding parameters. glow-up on a schedule, periodt πBN_BLINDING_convert_ex()β multipliesnwith the blinding factorA. and ifris notNULL, a copy of the inverse blinding factorAigets returned inr(which is super useful if anRSAobject is shared among several threads, iykyk π§΅). MeanwhileBN_BLINDING_invert_ex()multipliesnwith the inverse blinding factorAi, and ifris notNULLit will be used as the inverse blinding.BN_BLINDING_convert()andBN_BLINDING_invert()β these are just wrapper functions forBN_BLINDING_convert_ex()andBN_BLINDING_invert_ex()withrset toNULL. lowkey the lazy-girl versions and we respect it πBN_BLINDING_is_current_thread()β returns whether theBN_BLINDINGstructure is owned by the current thread. this exists to help users provide proper locking if needed for multi-threaded use π«ΆBN_BLINDING_set_current_thread()β sets the current thread as the owner of theBN_BLINDINGstructure. main character claims the object, slay πBN_BLINDING_lock()β locks theBN_BLINDINGstructure πBN_BLINDING_unlock()β unlocks theBN_BLINDINGstructure πBN_BLINDING_get_flags()β returns theBN_BLINDINGflags. Currently there are two supported flags:BN_BLINDING_NO_UPDATEandBN_BLINDING_NO_RECREATE.BN_BLINDING_NO_UPDATEinhibits the automatic update of theBN_BLINDINGparameters after each use, andBN_BLINDING_NO_RECREATEinhibits the automatic re-creation of theBN_BLINDINGparameters after a fixed number of uses (currently32). In newly allocatedBN_BLINDINGobjects, no flags are set β a clean slate, a fresh start π±. AndBN_BLINDING_set_flags()sets theBN_BLINDINGparameters flags.BN_BLINDING_create_param()β creates newBN_BLINDINGparameters using the exponenteand the modulusm.bn_mod_expandm_ctxcan be used to pass special functions for exponentiation (normallyBN_mod_exp_mont()andBN_MONT_CTX) π₯
π¦ RETURN VALUES π¦
BN_BLINDING_new()β returns the newly allocatedBN_BLINDINGstructure, orNULLin case of an error πBN_BLINDING_update(),BN_BLINDING_convert(),BN_BLINDING_invert(),BN_BLINDING_convert_ex()andBN_BLINDING_invert_ex()β return1on success and0if an error occurredBN_BLINDING_is_current_thread()β returns1if the current thread owns theBN_BLINDINGobject,0otherwiseBN_BLINDING_set_current_thread()β doesn't return anything. silent. mysterious. iconic π§BN_BLINDING_lock(),BN_BLINDING_unlock()β return1if the operation succeeded or0on errorBN_BLINDING_get_flags()β returns the currently setBN_BLINDINGflags (aunsigned longvalue)BN_BLINDING_create_param()β returns the newly createdBN_BLINDINGparameters orNULLon error
π HISTORY π
okay so storytime π: BN_BLINDING_thread_id() was first introduced in OpenSSL 1.0.0, and it deprecates BN_BLINDING_set_thread_id() and BN_BLINDING_get_thread_id(). old ones, we thank you for your service ππ«‘
π COPYRIGHT π
Copyright 2005-2017 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (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 <https://www.openssl.org/source/license.html>.
fr fr bestie, that's the whole page β every flag, every return value, every single NULL check, nothing skipped π
okay and that's a wrap on this one, mwah π
β¨ this was BN_BLINDING_NEW(3ossl) from OpenSSL 3.5.9, dated 2026-09-29 β go forth and blind responsibly, ily ππ¦πΈ
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms