| 807 | // Noise |
| 808 | |
| 809 | void NoiseSymmetricState::Init (const uint8_t * ck, const uint8_t * hh, const uint8_t * pub) |
| 810 | { |
| 811 | // pub is Bob's public static key, hh = SHA256(h) |
| 812 | memcpy (m_CK, ck, 32); |
| 813 | |
| 814 | EVP_MD_CTX *ctx = EVP_MD_CTX_new (); |
| 815 | EVP_DigestInit_ex(ctx, EVP_sha256 (), NULL); |
| 816 | EVP_DigestUpdate (ctx, hh, 32); |
| 817 | EVP_DigestUpdate (ctx, pub, 32); |
| 818 | EVP_DigestFinal_ex (ctx, m_H, nullptr); // h = MixHash(pub) = SHA256(hh || pub) |
| 819 | EVP_MD_CTX_free (ctx); |
| 820 | m_N = 0; |
| 821 | } |
| 822 | |
| 823 | void NoiseSymmetricState::MixHash (const uint8_t * buf, size_t len) |
| 824 | { |
no outgoing calls
no test coverage detected