27 std::array<uint8, 1>
const SRP6::g = { 7 };
28 std::array<uint8, 32>
const SRP6::N = HexStrToByteArray<32>(
"894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7",
true);
34 std::pair<SRP6::Salt, SRP6::Verifier> res;
57 buf0[i] = S[2 * i + 0];
58 buf1[i] = S[2 * i + 1];
75 K[2 * i + 0] = hash0[i];
76 K[2 * i + 1] = hash1[i];
82 : _I(
SHA1::GetDigestOf(username)), _b(Crypto::
GetRandomBytes<32>()), _v(verifier), s(salt), B(_B(_b, _v)) {}
86 ASSERT(!
_used,
"A single SRP6 object must only ever be used to verify ONCE!");
90 if ((_A %
_N).IsZero())
102 std::transform(NHash.begin(), NHash.end(), gHash.begin(), NgHash.begin(), std::bit_xor<>());
std::array< uint8, SESSION_KEY_LENGTH > SessionKey
Trinity::Crypto::SRP6 SRP6
BigNumber ModExp(BigNumber const &bn1, BigNumber const &bn2) const
std::array< uint8, Size > ToByteArray(bool littleEndian=true) const
static Verifier CalculateVerifier(std::string const &username, std::string const &password, Salt const &salt)
std::optional< SessionKey > VerifyChallengeResponse(EphemeralKey const &A, SHA1::Digest const &clientM)
static SessionKey SHA1Interleave(EphemeralKey const &S)
static std::array< uint8, 32 > const N
static BigNumber const _N
std::array< uint8, SALT_LENGTH > Salt
std::array< uint8, EPHEMERAL_KEY_LENGTH > EphemeralKey
SRP6(std::string const &username, Salt const &salt, Verifier const &verifier)
static std::pair< Salt, Verifier > MakeRegistrationData(std::string const &username, std::string const &password)
static std::array< uint8, 1 > const g
std::array< uint8, VERIFIER_LENGTH > Verifier
static constexpr size_t EPHEMERAL_KEY_LENGTH
static BigNumber const _g
std::array< uint8, DIGEST_LENGTH > Digest
static constexpr size_t DIGEST_LENGTH
static Digest GetDigestOf(uint8 const *data, size_t len)
Trinity::Impl::GenericHash< EVP_sha1, Constants::SHA1_DIGEST_LENGTH_BYTES > SHA1
void TC_COMMON_API GetRandomBytes(uint8 *buf, size_t len)