/* * Unit tests for rsaenh functions * * Copyright (c) 2004 Michael Jung * Copyright (c) 2006 Juan Lang * Copyright (c) 2007 Vijay Kiran Kamuju * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include #include #include "wine/test.h" #include "windef.h" #include "winbase.h" #include "winerror.h" #include "wincrypt.h" static HCRYPTPROV hProv; static const char szContainer[] = "winetest"; static const unsigned char pbData[] = "Wine rocks totally!"; static const char szProvider[] = MS_ENHANCED_PROV_A; typedef struct _ctdatatype { unsigned char origstr[32]; unsigned char decstr[32]; int strlen; int enclen; int buflen; } cryptdata; static const cryptdata cTestData[4] = { {"abcdefghijkl", {'a','b','c','d','e','f','g','h',0x2,0x2,'k','l',0}, 12,8,16}, {"abcdefghij", {'a','b','c','d','e','f','g','h',0x2,0x2,0}, 10,8,16}, {"abcdefgh", {'a','b','c','d','e','f','g','h',0}, 8,8,16}, {"abcdefghijkl", {'a','b','c','d','e','f','g','h','i','j','k','l',0}, 12,12,16} }; static void printBytes(const char *heading, const BYTE *pb, size_t cb) { size_t i; printf("%s: ",heading); for(i=0;i