MCPcopy Create free account
hub / github.com/ROCm/clr / decryptElf

Method decryptElf

rocclr/device/device.cpp:1406–1431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1404}
1405
1406bool ClBinary::decryptElf(const char* binaryIn, size_t size, char** decryptBin, size_t* decryptSize,
1407 int* encryptCode) {
1408 *decryptBin = nullptr;
1409#if defined(HAVE_BLOWFISH_H)
1410 int outBufSize = 0;
1411 if (amd::isEncryptedBIF(binaryIn, (int)size, &outBufSize)) {
1412 char* outBuf = new (std::nothrow) char[outBufSize];
1413 if (outBuf == nullptr) {
1414 return false;
1415 }
1416
1417 // Decrypt
1418 int outDataSize = 0;
1419 if (!amd::oclDecrypt(binaryIn, (int)size, outBuf, outBufSize, &outDataSize)) {
1420 delete[] outBuf;
1421 DevLogError("Cannot Decrypt Image \n");
1422 return false;
1423 }
1424
1425 *decryptBin = reinterpret_cast<char*>(outBuf);
1426 *decryptSize = outDataSize;
1427 *encryptCode = 1;
1428 }
1429#endif
1430 return true;
1431}
1432
1433bool ClBinary::setElfIn() {
1434 if (elfIn_) return true;

Callers 2

initClBinaryMethod · 0.80
initClBinaryMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected