MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / InitNoiseIKState

Function InitNoiseIKState

libi2pd/Crypto.cpp:922–935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

920 }
921
922 void InitNoiseIKState (NoiseSymmetricState& state, const uint8_t * pub)
923 {
924 static constexpr uint8_t protocolNameHash[32] =
925 {
926 0x4c, 0xaf, 0x11, 0xef, 0x2c, 0x8e, 0x36, 0x56, 0x4c, 0x53, 0xe8, 0x88, 0x85, 0x06, 0x4d, 0xba,
927 0xac, 0xbe, 0x00, 0x54, 0xad, 0x17, 0x8f, 0x80, 0x79, 0xa6, 0x46, 0x82, 0x7e, 0x6e, 0xe4, 0x0c
928 }; // SHA256("Noise_IKelg2+hs2_25519_ChaChaPoly_SHA256"), 40 bytes
929 static constexpr uint8_t hh[32] =
930 {
931 0x9c, 0xcf, 0x85, 0x2c, 0xc9, 0x3b, 0xb9, 0x50, 0x44, 0x41, 0xe9, 0x50, 0xe0, 0x1d, 0x52, 0x32,
932 0x2e, 0x0d, 0x47, 0xad, 0xd1, 0xe9, 0xa5, 0x55, 0xf7, 0x55, 0xb5, 0x69, 0xae, 0x18, 0x3b, 0x5c
933 }; // SHA256 (protocolNameHash)
934 state.Init (protocolNameHash, hh, pub);
935 }
936
937// init and terminate
938

Callers 2

Calls 1

InitMethod · 0.45

Tested by

no test coverage detected