MCPcopy Create free account
hub / github.com/ValveSoftware/GameNetworkingSockets / SetFromHexEncodedString

Method SetFromHexEncodedString

src/common/keypair.cpp:312–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312bool CCryptoKeyBase::SetFromHexEncodedString( const char *pchEncodedKey )
313{
314 Wipe();
315
316 uint32 cubKey = V_strlen( pchEncodedKey ) / 2 + 1;
317 void *buf = alloca( cubKey );
318
319 if ( !CCrypto::HexDecode( pchEncodedKey, buf, &cubKey ) )
320 {
321 SecureZeroMemory( buf, cubKey );
322 return false;
323 }
324
325 return SetRawDataAndWipeInput( buf, cubKey );
326}
327
328
329//-----------------------------------------------------------------------------

Callers 2

PrintDHKeyFunction · 0.80
TestEllipticCryptoFunction · 0.80

Calls 2

V_strlenFunction · 0.85
SecureZeroMemoryFunction · 0.85

Tested by 1

TestEllipticCryptoFunction · 0.64