MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / test_openSSL_des

Function test_openSSL_des

extra/yassl/testsuite/testsuite.cpp:157–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155
156
157int test_openSSL_des()
158{
159 /* test des encrypt/decrypt */
160 char data[] = "this is my data ";
161 int dataSz = (int)strlen(data);
162 DES_key_schedule key[3];
163 byte iv[8];
164 EVP_BytesToKey(EVP_des_ede3_cbc(), EVP_md5(), NULL, (byte*)data, dataSz, 1,
165 (byte*)key, iv);
166
167 byte cipher[16];
168 DES_ede3_cbc_encrypt((byte*)data, cipher, dataSz, &key[0], &key[1],
169 &key[2], &iv, true);
170 byte plain[16];
171 DES_ede3_cbc_encrypt(cipher, plain, 16, &key[0], &key[1], &key[2],
172 &iv, false);
173 return 0;
174}

Callers

nothing calls this directly

Calls 4

EVP_BytesToKeyFunction · 0.85
EVP_des_ede3_cbcFunction · 0.85
EVP_md5Function · 0.85
DES_ede3_cbc_encryptFunction · 0.85

Tested by

no test coverage detected