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

Function InitNoiseNState

libi2pd/Crypto.cpp:881–890  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

879 }
880
881 void InitNoiseNState (NoiseSymmetricState& state, const uint8_t * pub)
882 {
883 static constexpr char protocolName[] = "Noise_N_25519_ChaChaPoly_SHA256"; // 31 chars
884 static constexpr uint8_t hh[32] =
885 {
886 0x69, 0x4d, 0x52, 0x44, 0x5a, 0x27, 0xd9, 0xad, 0xfa, 0xd2, 0x9c, 0x76, 0x32, 0x39, 0x5d, 0xc1,
887 0xe4, 0x35, 0x4c, 0x69, 0xb4, 0xf9, 0x2e, 0xac, 0x8a, 0x1e, 0xe4, 0x6a, 0x9e, 0xd2, 0x15, 0x54
888 }; // hh = SHA256(protocol_name || 0)
889 state.Init ((const uint8_t *)protocolName, hh, pub); // ck = protocol_name || 0
890 }
891
892 void InitNoiseXKState (NoiseSymmetricState& state, const uint8_t * pub)
893 {

Callers 3

EncryptECIESMethod · 0.85
RouterContextMethod · 0.85

Calls 1

InitMethod · 0.45

Tested by

no test coverage detected