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_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

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 defining OPENSSL_API_COMPAT with a suitable version value β€” go peek at openssl_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 B and u parameters, and those get calculated by SRP_Calc_server_key(), SRP_Calc_B_ex(), SRP_Calc_B(), SRP_Calc_u_ex() and SRP_Calc_u() πŸ‘‘
  • the client side runs the client key plus the x and A parameters, calculated by SRP_Calc_client_key_ex(), SRP_Calc_client_key(), SRP_Calc_x_ex(), SRP_Calc_x() and SRP_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:

  1. the ones that take a libctx and propq parameter
  2. 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_ex and SRP_Calc_x_ex were 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 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