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

Function InitNoiseXKState

libi2pd/Crypto.cpp:892–905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

890 }
891
892 void InitNoiseXKState (NoiseSymmetricState& state, const uint8_t * pub)
893 {
894 static constexpr uint8_t protocolNameHash[32] =
895 {
896 0x72, 0xe8, 0x42, 0xc5, 0x45, 0xe1, 0x80, 0x80, 0xd3, 0x9c, 0x44, 0x93, 0xbb, 0x91, 0xd7, 0xed,
897 0xf2, 0x28, 0x98, 0x17, 0x71, 0x21, 0x8c, 0x1f, 0x62, 0x4e, 0x20, 0x6f, 0x28, 0xd3, 0x2f, 0x71
898 }; // SHA256 ("Noise_XKaesobfse+hs2+hs3_25519_ChaChaPoly_SHA256")
899 static constexpr uint8_t hh[32] =
900 {
901 0x49, 0xff, 0x48, 0x3f, 0xc4, 0x04, 0xb9, 0xb2, 0x6b, 0x11, 0x94, 0x36, 0x72, 0xff, 0x05, 0xb5,
902 0x61, 0x27, 0x03, 0x31, 0xba, 0x89, 0xb8, 0xfc, 0x33, 0x15, 0x93, 0x87, 0x57, 0xdd, 0x3d, 0x1e
903 }; // SHA256 (protocolNameHash)
904 state.Init (protocolNameHash, hh, pub);
905 }
906
907 void InitNoiseXKState1 (NoiseSymmetricState& state, const uint8_t * pub)
908 {

Callers 1

Calls 1

InitMethod · 0.45

Tested by

no test coverage detected