ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

crypt.h
Go to the documentation of this file.
00001 /*
00002  * Driver routines
00003  *
00004  * Copyright 2001 - Travis Michielsen
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00019  */
00020 
00021 #ifndef __WINE_CRYPT_H
00022 #define __WINE_CRYPT_H
00023 
00024 #include <stdarg.h>
00025 
00026 #include "windef.h"
00027 #include "winbase.h"
00028 #include "wincrypt.h"
00029 
00030 typedef struct tagPROVFUNCS
00031 {
00032     BOOL (WINAPI *pCPAcquireContext)(HCRYPTPROV *phProv, LPSTR pszContainer, DWORD dwFlags, PVTableProvStruc pVTable);
00033     BOOL (WINAPI *pCPCreateHash)(HCRYPTPROV hProv, ALG_ID Algid, HCRYPTKEY hKey, DWORD dwFlags, HCRYPTHASH *phHash);
00034     BOOL (WINAPI *pCPDecrypt)(HCRYPTPROV hProv, HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final, DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen);
00035     BOOL (WINAPI *pCPDeriveKey)(HCRYPTPROV hProv, ALG_ID     Algid, HCRYPTHASH hBaseData, DWORD dwFlags, HCRYPTKEY *phKey);
00036     BOOL (WINAPI *pCPDestroyHash)(HCRYPTPROV hProv, HCRYPTHASH hHash);
00037     BOOL (WINAPI *pCPDestroyKey)(HCRYPTPROV hProv, HCRYPTKEY hKey);
00038     BOOL (WINAPI *pCPDuplicateHash)(HCRYPTPROV hUID, HCRYPTHASH hHash, DWORD *pdwReserved, DWORD dwFlags, HCRYPTHASH *phHash);
00039     BOOL (WINAPI *pCPDuplicateKey)(HCRYPTPROV hUID, HCRYPTKEY hKey, DWORD *pdwReserved, DWORD dwFlags, HCRYPTKEY *phKey);
00040     BOOL (WINAPI *pCPEncrypt)(HCRYPTPROV hProv, HCRYPTKEY hKey, HCRYPTHASH hHash, BOOL Final, DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen, DWORD dwBufLen);
00041     BOOL (WINAPI *pCPExportKey)(HCRYPTPROV hProv, HCRYPTKEY hKey, HCRYPTKEY hPubKey, DWORD dwBlobType, DWORD dwFlags, BYTE *pbData, DWORD *pdwDataLen);
00042     BOOL (WINAPI *pCPGenKey)(HCRYPTPROV hProv, ALG_ID Algid, DWORD dwFlags, HCRYPTKEY *phKey);
00043     BOOL (WINAPI *pCPGenRandom)(HCRYPTPROV hProv, DWORD dwLen, BYTE *pbBuffer);
00044     BOOL (WINAPI *pCPGetHashParam)(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags);
00045     BOOL (WINAPI *pCPGetKeyParam)(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags);
00046     BOOL (WINAPI *pCPGetProvParam)(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags);
00047     BOOL (WINAPI *pCPGetUserKey)(HCRYPTPROV hProv, DWORD dwKeySpec, HCRYPTKEY *phUserKey);
00048     BOOL (WINAPI *pCPHashData)(HCRYPTPROV hProv, HCRYPTHASH hHash, CONST BYTE *pbData, DWORD dwDataLen, DWORD dwFlags);
00049     BOOL (WINAPI *pCPHashSessionKey)(HCRYPTPROV hProv, HCRYPTHASH hHash, HCRYPTKEY hKey, DWORD dwFlags);
00050     BOOL (WINAPI *pCPImportKey)(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDataLen, HCRYPTKEY hPubKey, DWORD dwFlags, HCRYPTKEY *phKey);
00051     BOOL (WINAPI *pCPReleaseContext)(HCRYPTPROV hProv, DWORD dwFlags);
00052     BOOL (WINAPI *pCPSetHashParam)(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwParam, CONST BYTE *pbData, DWORD dwFlags);
00053     BOOL (WINAPI *pCPSetKeyParam)(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam, CONST BYTE *pbData, DWORD dwFlags);
00054     BOOL (WINAPI *pCPSetProvParam)(HCRYPTPROV hProv, DWORD dwParam, CONST BYTE *pbData, DWORD dwFlags);
00055     BOOL (WINAPI *pCPSignHash)(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwKeySpec, LPCWSTR sDescription, DWORD dwFlags, BYTE *pbSignature, DWORD *pdwSigLen);
00056     BOOL (WINAPI *pCPVerifySignature)(HCRYPTPROV hProv, HCRYPTHASH hHash, CONST BYTE *pbSignature, DWORD dwSigLen, HCRYPTKEY hPubKey, LPCWSTR sDescription, DWORD dwFlags);
00057 } PROVFUNCS, *PPROVFUNCS;
00058 
00059 #define MAGIC_CRYPTPROV 0xA39E741F
00060 
00061 typedef struct tagCRYPTPROV
00062 {
00063     DWORD dwMagic;
00064     UINT refcount;
00065     HMODULE hModule;
00066     PPROVFUNCS pFuncs;
00067         HCRYPTPROV hPrivate;  /*CSP's handle - Should not be given to application under any circumstances!*/
00068     PVTableProvStruc pVTable;
00069 } CRYPTPROV, *PCRYPTPROV;
00070 
00071 typedef struct tagCRYPTKEY
00072 {
00073     PCRYPTPROV pProvider;
00074         HCRYPTKEY hPrivate;    /*CSP's handle - Should not be given to application under any circumstances!*/
00075 } CRYPTKEY, *PCRYPTKEY;
00076 
00077 typedef struct tagCRYPTHASH
00078 {
00079     PCRYPTPROV pProvider;
00080         HCRYPTHASH hPrivate;    /*CSP's handle - Should not be given to application under any circumstances!*/
00081 } CRYPTHASH, *PCRYPTHASH;
00082 
00083 #define MAXPROVTYPES 999
00084 
00085 extern unsigned char *CRYPT_DEShash( unsigned char *dst, const unsigned char *key,
00086                                      const unsigned char *src );
00087 extern unsigned char *CRYPT_DESunhash( unsigned char *dst, const unsigned char *key,
00088                                        const unsigned char *src );
00089 
00090 void byteReverse(unsigned char *buf, unsigned longs);
00091 struct ustring {
00092     DWORD Length;
00093     DWORD MaximumLength;
00094     unsigned char *Buffer;
00095 };
00096 
00097 typedef struct {
00098     unsigned int buf[4];
00099     unsigned int i[2];
00100     unsigned char in[64];
00101     unsigned char digest[16];
00102 } MD4_CTX;
00103 
00104 typedef struct tag_arc4_info {
00105     unsigned char state[256];
00106     unsigned char x, y;
00107 } arc4_info;
00108 
00109 VOID WINAPI MD4Init( MD4_CTX *ctx );
00110 VOID WINAPI MD4Update( MD4_CTX *ctx, const unsigned char *buf, unsigned int len );
00111 VOID WINAPI MD4Final(MD4_CTX *ctx);
00112 void arc4_init(arc4_info *a4i, const BYTE *key, unsigned int keyLen);
00113 void arc4_ProcessString(arc4_info *a4i, BYTE *inoutString, unsigned int length);
00114 NTSTATUS WINAPI SystemFunction032(struct ustring *data, struct ustring *key);
00115 
00116 
00117 #endif /* __WINE_CRYPT_H_ */

Generated on Mon May 28 2012 04:22:09 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.