2004-11-04 22:15:32 +01:00
|
|
|
/*
|
2004-11-30 18:43:59 +01:00
|
|
|
* dlls/rsaenh/implglue.h
|
|
|
|
* Glueing the RSAENH specific code to the crypto library
|
2004-11-04 22:15:32 +01:00
|
|
|
*
|
|
|
|
* Copyright (c) 2004 Michael Jung
|
|
|
|
*
|
|
|
|
* based on code by Mike McCormack and David Hammerton
|
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-11-04 22:15:32 +01:00
|
|
|
*/
|
|
|
|
|
2004-11-30 18:43:59 +01:00
|
|
|
#ifndef __WINE_IMPLGLUE_H
|
|
|
|
#define __WINE_IMPLGLUE_H
|
2004-11-04 22:15:32 +01:00
|
|
|
|
2004-11-30 18:43:59 +01:00
|
|
|
#include "tomcrypt.h"
|
2010-03-15 20:04:29 +01:00
|
|
|
#include "sha2.h"
|
2004-11-04 22:15:32 +01:00
|
|
|
|
|
|
|
/* Next typedef copied from dlls/advapi32/crypt_md4.c */
|
|
|
|
typedef struct tagMD4_CTX {
|
|
|
|
unsigned int buf[4];
|
|
|
|
unsigned int i[2];
|
|
|
|
unsigned char in[64];
|
|
|
|
unsigned char digest[16];
|
|
|
|
} MD4_CTX;
|
|
|
|
|
|
|
|
/* Next typedef copied from dlls/advapi32/crypt_md5.c */
|
|
|
|
typedef struct tagMD5_CTX
|
|
|
|
{
|
|
|
|
unsigned int i[2];
|
|
|
|
unsigned int buf[4];
|
|
|
|
unsigned char in[64];
|
|
|
|
unsigned char digest[16];
|
|
|
|
} MD5_CTX;
|
|
|
|
|
|
|
|
/* Next typedef copied form dlls/advapi32/crypt_sha.c */
|
|
|
|
typedef struct tagSHA_CTX
|
|
|
|
{
|
|
|
|
ULONG Unknown[6];
|
|
|
|
ULONG State[5];
|
|
|
|
ULONG Count[2];
|
|
|
|
UCHAR Buffer[64];
|
|
|
|
} SHA_CTX, *PSHA_CTX;
|
|
|
|
|
|
|
|
typedef union tagHASH_CONTEXT {
|
2004-11-30 18:43:59 +01:00
|
|
|
md2_state md2;
|
2004-11-04 22:15:32 +01:00
|
|
|
MD4_CTX md4;
|
|
|
|
MD5_CTX md5;
|
|
|
|
SHA_CTX sha;
|
2010-03-15 20:04:29 +01:00
|
|
|
SHA256_CTX sha256;
|
|
|
|
SHA384_CTX sha384;
|
|
|
|
SHA512_CTX sha512;
|
2004-11-04 22:15:32 +01:00
|
|
|
} HASH_CONTEXT;
|
|
|
|
|
|
|
|
typedef union tagKEY_CONTEXT {
|
2004-11-30 18:43:59 +01:00
|
|
|
rc2_key rc2;
|
|
|
|
des_key des;
|
|
|
|
des3_key des3;
|
2007-11-20 23:58:23 +01:00
|
|
|
aes_key aes;
|
2004-11-30 18:43:59 +01:00
|
|
|
prng_state rc4;
|
|
|
|
rsa_key rsa;
|
2004-11-04 22:15:32 +01:00
|
|
|
} KEY_CONTEXT;
|
|
|
|
|
2011-05-13 18:14:56 +02:00
|
|
|
BOOL init_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext) DECLSPEC_HIDDEN;
|
2004-11-04 22:15:32 +01:00
|
|
|
BOOL update_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, CONST BYTE *pbData,
|
2011-05-13 18:14:56 +02:00
|
|
|
DWORD dwDataLen) DECLSPEC_HIDDEN;
|
|
|
|
BOOL finalize_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, BYTE *pbHashValue) DECLSPEC_HIDDEN;
|
2004-11-04 22:15:32 +01:00
|
|
|
BOOL duplicate_hash_impl(ALG_ID aiAlgid, CONST HASH_CONTEXT *pSrcHashContext,
|
2011-05-13 18:14:56 +02:00
|
|
|
HASH_CONTEXT *pDestHashContext) DECLSPEC_HIDDEN;
|
2004-11-04 22:15:32 +01:00
|
|
|
|
2011-05-13 18:14:56 +02:00
|
|
|
BOOL new_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen) DECLSPEC_HIDDEN;
|
|
|
|
BOOL free_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext) DECLSPEC_HIDDEN;
|
2007-09-11 00:05:24 +02:00
|
|
|
BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
|
2011-05-13 18:14:56 +02:00
|
|
|
DWORD dwEffectiveKeyLen, DWORD dwSaltLen, BYTE *abKeyValue) DECLSPEC_HIDDEN;
|
2004-11-04 22:15:32 +01:00
|
|
|
BOOL duplicate_key_impl(ALG_ID aiAlgid, CONST KEY_CONTEXT *pSrcKeyContext,
|
2011-05-13 18:14:56 +02:00
|
|
|
KEY_CONTEXT *pDestKeyContext) DECLSPEC_HIDDEN;
|
2004-11-04 22:15:32 +01:00
|
|
|
|
2006-09-28 19:50:50 +02:00
|
|
|
/* dwKeySpec is optional for symmetric key algorithms */
|
|
|
|
BOOL encrypt_block_impl(ALG_ID aiAlgid, DWORD dwKeySpec, KEY_CONTEXT *pKeyContext, CONST BYTE *pbIn, BYTE *pbOut,
|
2011-05-13 18:14:56 +02:00
|
|
|
DWORD enc) DECLSPEC_HIDDEN;
|
|
|
|
BOOL encrypt_stream_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, BYTE *pbInOut, DWORD dwLen) DECLSPEC_HIDDEN;
|
2004-11-04 22:15:32 +01:00
|
|
|
|
2007-08-23 22:32:19 +02:00
|
|
|
BOOL export_public_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
|
2011-05-13 18:14:56 +02:00
|
|
|
DWORD *pdwPubExp) DECLSPEC_HIDDEN;
|
2004-11-04 22:15:32 +01:00
|
|
|
BOOL import_public_key_impl(CONST BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
|
2011-05-13 18:14:56 +02:00
|
|
|
DWORD dwPubExp) DECLSPEC_HIDDEN;
|
2007-08-23 22:32:19 +02:00
|
|
|
BOOL export_private_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
|
2011-05-13 18:14:56 +02:00
|
|
|
DWORD *pdwPubExp) DECLSPEC_HIDDEN;
|
2004-11-04 22:15:32 +01:00
|
|
|
BOOL import_private_key_impl(CONST BYTE* pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
|
2011-10-31 18:44:23 +01:00
|
|
|
DWORD dwDataLen, DWORD dwPubExp) DECLSPEC_HIDDEN;
|
2004-11-04 22:15:32 +01:00
|
|
|
|
2011-05-13 18:14:56 +02:00
|
|
|
BOOL gen_rand_impl(BYTE *pbBuffer, DWORD dwLen) DECLSPEC_HIDDEN;
|
2004-11-04 22:15:32 +01:00
|
|
|
|
2004-11-30 18:43:59 +01:00
|
|
|
#endif /* __WINE_IMPLGLUE_H */
|