MCPcopy Create free account
hub / github.com/CommE2E/comm / decrypt

Method decrypt

native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp:338–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338std::string CryptoModule::decrypt(
339 const std::string &targetDeviceId,
340 EncryptedData &encryptedData) {
341 if (!this->hasSessionFor(targetDeviceId)) {
342 throw std::runtime_error{SESSION_DOES_NOT_EXIST_ERROR};
343 }
344 auto session = this->sessions.at(targetDeviceId);
345 if (encryptedData.sessionVersion.has_value() &&
346 encryptedData.sessionVersion.value() < session->getVersion()) {
347 throw std::runtime_error{INVALID_SESSION_VERSION_ERROR};
348 }
349 return session->decrypt(encryptedData);
350}
351
352std::string CryptoModule::signMessage(const std::string &message) {
353 try {

Callers

nothing calls this directly

Calls 3

hasSessionForMethod · 0.95
getVersionMethod · 0.80
decryptMethod · 0.65

Tested by

no test coverage detected