SRP_CALC_B(3SSL)
β¨ NAME β¨
hey bestie π welcome to SRP_CALC_B(3SSL), one of the OpenSSL manual pages, and it's giving SRP authentication primitives. that's the whole vibe of this page, no cap.
the squad in question is:
SRP_Calc_server_keySRP_Calc_ASRP_Calc_B_exSRP_Calc_BSRP_Calc_u_exSRP_Calc_uSRP_Calc_x_exSRP_Calc_xSRP_Calc_client_key_exSRP_Calc_client_key
periodt. these are the SRP authentication primitives, and every single one of them is living on this page together like one big group chat π«Ά
π¦ SYNOPSIS π¦
first things first, you gotta pull in the header:
#include <openssl/srp.h>
π¨ okay so important heads-up bestie: the functions below have been deprecated since OpenSSL 3.0, and you can hide them entirely by definingOPENSSL_API_COMPATwith a suitable version value β go peek atopenssl_user_macros(7)for the tea. π
here's the whole roster, server side first:
/* 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);
/* 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 πΈ
okay so first, the elephant in the room π β all of the functions described on this page are deprecated. and not in a cute nostalgic way, in a "there are no available replacement functions at this time" way π that's literally the situation: no replacements exist yet.
now, the actual lore. these SRP functions calculate the various parameters and keys that SRP uses, as defined in RFC2945. here's how the sides shake out:
- the server side runs the server key plus the
Banduparameters, and those get calculated bySRP_Calc_server_key(),SRP_Calc_B_ex(),SRP_Calc_B(),SRP_Calc_u_ex()andSRP_Calc_u()π - the client side runs the client key plus the
xandAparameters, calculated bySRP_Calc_client_key_ex(),SRP_Calc_client_key(),SRP_Calc_x_ex(),SRP_Calc_x()andSRP_Calc_A()π§
if you want the detailed description of how they're used, and what all those various BIGNUM parameters actually mean, go read RFC2945 β that's where the full breakdown lives, iykyk.
π two forms, bestie π
most of these functions come in two flavors:
- the ones that take a
libctxandpropqparameter - the ones that don't
any cryptographic functions that get fetched and used during the calculation use the provided libctx and propq β see "ALGORITHM FETCHING" in crypto(7) for more details, it's literally all there π
the variants that don't take libctx and propq just use the default library context and property query string.
and the special ones: SRP_Calc_server_key() and SRP_Calc_A() do not have a form that takes libctx or propq parameters, because they don't need to fetch any cryptographic algorithms. they're the low-maintenance ones, iconic honestly π
π RETURN VALUES π
all these functions return the calculated key or parameter... or NULL on error. that's it, that's the whole story π
π SEE ALSO π
π HISTORY π
the timeline, because bestie deserves receipts π§Ύ:
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... all of these functions were deprecated in OpenSSL 3.0 π
so the _ex girlies arrived and got deprecated in the same era. it's giving "showed up to the party as it was ending."
π 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>.
okay that's the whole page, bestie β this was SRP_CALC_B(3SSL) from OpenSSL, version 4.0.3, dated 2026-09-29. go forth and calculate those SRP primitives responsibly, mwah πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms