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

Method Encaps

libi2pd/PostQuantum.cpp:70–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 }
69
70 void MLKEMKeys::Encaps (uint8_t * ciphertext, uint8_t * shared)
71 {
72 if (!m_Pkey) return;
73 auto ctx = EVP_PKEY_CTX_new_from_pkey (NULL, m_Pkey, NULL);
74 if (ctx)
75 {
76 EVP_PKEY_encapsulate_init (ctx, NULL);
77 size_t len = m_CTLen, sharedLen = 32;
78 EVP_PKEY_encapsulate (ctx, ciphertext, &len, shared, &sharedLen);
79 EVP_PKEY_CTX_free (ctx);
80 }
81 else
82 LogPrint (eLogError, "MLKEM can't create PKEY context");
83 }
84
85 void MLKEMKeys::Decaps (const uint8_t * ciphertext, uint8_t * shared)
86 {

Callers 4

SendSessionCreatedMethod · 0.80

Calls 1

LogPrintFunction · 0.85

Tested by

no test coverage detected