| 68 | } |
| 69 | |
| 70 | bool NTCP2Establisher::KeyDerivationFunction1 (const uint8_t * pub, i2p::crypto::X25519Keys& priv, const uint8_t * rs, const uint8_t * epub) |
| 71 | { |
| 72 | #if OPENSSL_PQ |
| 73 | if (m_CryptoType == i2p::data::CRYPTO_KEY_TYPE_ECIES_X25519_AEAD) |
| 74 | i2p::crypto::InitNoiseXKState (*this, rs); |
| 75 | else |
| 76 | i2p::crypto::InitNoiseXKStateMLKEM (*this, m_CryptoType, rs); |
| 77 | #else |
| 78 | i2p::crypto::InitNoiseXKState (*this, rs); |
| 79 | #endif |
| 80 | // h = SHA256(h || epub) |
| 81 | MixHash (epub, 32); |
| 82 | // x25519 between pub and priv |
| 83 | uint8_t inputKeyMaterial[32]; |
| 84 | if (!priv.Agree (pub, inputKeyMaterial)) return false; |
| 85 | MixKey (inputKeyMaterial); |
| 86 | return true; |
| 87 | } |
| 88 | |
| 89 | bool NTCP2Establisher::KDF1Alice () |
| 90 | { |
nothing calls this directly
no test coverage detected