MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Platform_Encrypt

Function Platform_Encrypt

src/Platform_Windows.c:1086–1101  ·  view source on GitHub ↗

#######################################################################################################################* *-------------------------------------------------------Encryption--------------------------------------------------------* *#########################################################################################################################*/

Source from the content-addressed store, hash-verified

1084*-------------------------------------------------------Encryption--------------------------------------------------------*
1085*#########################################################################################################################*/
1086cc_result Platform_Encrypt(const void* data, int len, cc_string* dst) {
1087 DATA_BLOB input, output;
1088 int i;
1089 input.cbData = len; input.pbData = (BYTE*)data;
1090
1091 Crypt32_LoadDynamicFuncs();
1092 if (!_CryptProtectData) return ERR_NOT_SUPPORTED;
1093 if (!_CryptProtectData(&input, NULL, NULL, NULL, NULL, 0, &output)) return GetLastError();
1094
1095 for (i = 0; i < output.cbData; i++)
1096 {
1097 String_Append(dst, output.pbData[i]);
1098 }
1099 LocalFree(output.pbData);
1100 return 0;
1101}
1102
1103cc_result Platform_Decrypt(const void* data, int len, cc_string* dst) {
1104 DATA_BLOB input, output;

Callers

nothing calls this directly

Calls 2

Crypt32_LoadDynamicFuncsFunction · 0.85
String_AppendFunction · 0.85

Tested by

no test coverage detected