void CSimplePanelDlg::InitPannel() { CDC* pDC = GetDC(); char curDir[160] = {0}; WCHAR wcurDir[160] = {0}; GetCurrentDirectory(160, curDir); ZeroMemory(wcurDir, sizeof(wcurDir)); CString strImPath = curDir; strImPath += _T("\\Res\\linepannel_simple.png"); MultiByteToWideChar(CP_ACP, 0, (char*)(LPCTSTR)strImPath, strImPath.GetLength(), wcurDir, 160); m_pImLineBK = new Gdiplus::Image(wcurDir); int nHeight = m_pImLineBK->GetHeight(); int nWidth = m_pImLineBK->GetWidth(); CRect rc1(0, 46, 539, nHeight + 46); CEsayMemDC* pMemDC = new CEsayMemDC(*pDC, rc1); m_vecMemDC.push_back(pMemDC); CRect rc2(542, 46, 1080, nHeight + 46); pMemDC = new CEsayMemDC(*pDC, rc2); m_vecMemDC.push_back(pMemDC); CRect rc3(0, nHeight + 52, 540, nHeight*2 + 52); pMemDC = new CEsayMemDC(*pDC, rc3); m_vecMemDC.push_back(pMemDC); CRect rc4(542, nHeight + 52, 1080, nHeight*2 + 52); pMemDC = new CEsayMemDC(*pDC, rc4); m_vecMemDC.push_back(pMemDC); CRect rc5(0, nHeight*2 + 58, 540, nHeight*3 + 58); pMemDC = new CEsayMemDC(*pDC, rc5); m_vecMemDC.push_back(pMemDC); CRect rc6(542, nHeight*2 + 58, 1080, nHeight*3 + 58); pMemDC = new CEsayMemDC(*pDC, rc6); m_vecMemDC.push_back(pMemDC); ReleaseDC(pDC); }
int main (void) { int i; uint8_t pt1[16], ct1[16], ct2[16], key[32]; for (i=0; i<sizeof (test_keys)/sizeof(char*); i++) { hex2bin (key, test_keys[i]); hex2bin (ct1, test_ciphertexts[i]); hex2bin (pt1, test_plaintexts[i]); memcpy(ct2, pt1, sizeof(ct2)); rc6(key, ct2); if (memcmp (ct1, ct2, sizeof(ct1))==0) { printf ("\nRC6 encryption passed #%i\n", (i+1)); } else { printf ("\nRC6 failed test #%i\n", (i+1)); } bin2hex("c:", ct2, sizeof(ct2)); } return 0; }