SRP_CALC_B(3ossl)
πΈ SRP_CALC_B(3ossl) β like, the whole SRP auth primitives situation π
okay bestie, buckle up, because this is the SRP_CALC_B(3ossl) page and it's about SRP authentication primitives β¨ β SRP_Calc_server_key, SRP_Calc_A, SRP_Calc_B_ex, SRP_Calc_B, SRP_Calc_u_ex, SRP_Calc_u, SRP_Calc_x_ex, SRP_Calc_x, SRP_Calc_client_key_ex, SRP_Calc_client_key. say that five times fast, i dare you π
β¨ SYNOPSIS β¨
#include <openssl/srp.h>
β οΈ heads up fr fr: all of the functions below have been deprecated since OpenSSL 3.0, and you can hide them entirely by definingOPENSSL_API_COMPATwith a suitable version value β peepopenssl_user_macros(7)for the deets π«Ά
server side besties, this is your moment:
/* server side .... */
BIGNUM *SRP_Calc_server_key(const BIGNUM *A, const BIGNUM *v, const BIGNUM *u,
const BIGNUM *b, const BIGNUM *N);
BIGNUM *SRP_Calc_B_ex(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
const BIGNUM *v, OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_B(const BIGNUM *b, const BIGNUM *N, const BIGNUM *g,
const BIGNUM *v);
BIGNUM *SRP_Calc_u_ex(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N,
OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_u(const BIGNUM *A, const BIGNUM *B, const BIGNUM *N);
and client side crew, here's yours π¦:
/* client side .... */
BIGNUM *SRP_Calc_client_key_ex(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u,
OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_client_key(const BIGNUM *N, const BIGNUM *B, const BIGNUM *g,
const BIGNUM *x, const BIGNUM *a, const BIGNUM *u);
BIGNUM *SRP_Calc_x_ex(const BIGNUM *s, const char *user, const char *pass,
OSSL_LIB_CTX *libctx, const char *propq);
BIGNUM *SRP_Calc_x(const BIGNUM *s, const char *user, const char *pass);
BIGNUM *SRP_Calc_A(const BIGNUM *a, const BIGNUM *N, const BIGNUM *g);
π DESCRIPTION π
so. the elephant in the room π: all of the functions described on this page are deprecated. and before you ask β no, there are no available replacement functions at this time. tragic, i know. π
the SRP functions here are what you use to calculate the various parameters and keys that SRP needs, as defined in RFC2945. think of this page as the math-y backstage of SRP π
- the server key and the B and u parameters are the server side girlies π
β they're calculated via
SRP_Calc_server_key(),SRP_Calc_B_ex(),SRP_Calc_B(),SRP_Calc_u_ex()andSRP_Calc_u() - the client key and the x and A parameters are the client side crew π¦ β calculated via
SRP_Calc_client_key_ex(),SRP_Calc_client_key(),SRP_Calc_x_ex(),SRP_Calc_x()andSRP_Calc_A()
for a detailed description of how all this is used, plus what the various BIGNUM parameters to these functions actually mean β go read RFC2945, it's giving required reading π
π§ the two-flavour situation π§
most of these functions come in two forms, and it's literally just about the extra params:
- the ones that take a
libctxandpropqparameter β¨ - the ones that don't π
any cryptographic functions that get fetched and used during the calculation will use the provided libctx and propq. see "ALGORITHM FETCHING" in crypto(7) for more details, iykyk.
the variants without the libctx and propq parameters just use the default library context and property query string. lowkey convenient.
π small note:SRP_Calc_server_key()andSRP_Calc_A()do not have a form that takeslibctxorpropqparameters β because they don't need to fetch any cryptographic algorithms at all. not them being self-sufficient π
β RETURN VALUES β
all these functions return the calculated key or parameter on success, or NULL on error. that's it, that's the whole vibe check π«Ά
π SEE ALSO π
π HISTORY π
SRP_Calc_B_ex,SRP_Calc_u_ex,SRP_Calc_client_key_exandSRP_Calc_x_exwere introduced in OpenSSL 3.0 β¨- all of the other functions were added in OpenSSL 1.0.1 π
- and then β plot twist β all of these functions were deprecated in OpenSSL 3.0 ππ
π COPYRIGHT π
Copyright 2020-2021 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>.
and that's the whole page bestie π«Άβ¨ this little beauty is from OpenSSL 3.5.0, dated 2026-09-25, and it lives at SRP_CALC_B(3ossl) β go forth and, like, don't use deprecated functions, mwah ππ
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms