qmgr: Use CRT allocation functions.
[wine.git] / dlls / rsaenh / implglue.h
blob06fa3f4430a7586064fc3f60fc5f69236f7e300a
1 /*
2 * dlls/rsaenh/implglue.h
3 * Glueing the RSAENH specific code to the crypto library
5 * Copyright (c) 2004 Michael Jung
7 * based on code by Mike McCormack and David Hammerton
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #ifndef __WINE_IMPLGLUE_H
25 #define __WINE_IMPLGLUE_H
27 #include "bcrypt.h"
28 #include "tomcrypt.h"
30 #define RSAENH_MAX_HASH_SIZE 104
32 typedef union tagKEY_CONTEXT {
33 rc2_key rc2;
34 des_key des;
35 des3_key des3;
36 aes_key aes;
37 prng_state rc4;
38 rsa_key rsa;
39 } KEY_CONTEXT;
41 BOOL init_hash_impl(ALG_ID aiAlgid, BCRYPT_HASH_HANDLE *hash_handle) DECLSPEC_HIDDEN;
42 BOOL update_hash_impl(BCRYPT_HASH_HANDLE hash_handle, const BYTE *pbData,
43 DWORD dwDataLen) DECLSPEC_HIDDEN;
44 BOOL finalize_hash_impl(BCRYPT_HASH_HANDLE hash_handle, BYTE *pbHashValue) DECLSPEC_HIDDEN;
45 BOOL duplicate_hash_impl(BCRYPT_HASH_HANDLE src_hash_handle,
46 BCRYPT_HASH_HANDLE *dest_hash_handle) DECLSPEC_HIDDEN;
48 BOOL new_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen) DECLSPEC_HIDDEN;
49 BOOL free_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext) DECLSPEC_HIDDEN;
50 BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
51 DWORD dwEffectiveKeyLen, DWORD dwSaltLen, BYTE *abKeyValue) DECLSPEC_HIDDEN;
52 BOOL duplicate_key_impl(ALG_ID aiAlgid, const KEY_CONTEXT *pSrcKeyContext,
53 KEY_CONTEXT *pDestKeyContext) DECLSPEC_HIDDEN;
55 /* dwKeySpec is optional for symmetric key algorithms */
56 BOOL encrypt_block_impl(ALG_ID aiAlgid, DWORD dwKeySpec, KEY_CONTEXT *pKeyContext, const BYTE *pbIn,
57 BYTE *pbOut, DWORD enc) DECLSPEC_HIDDEN;
58 BOOL encrypt_stream_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, BYTE *pbInOut, DWORD dwLen) DECLSPEC_HIDDEN;
60 BOOL export_public_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
61 DWORD *pdwPubExp) DECLSPEC_HIDDEN;
62 BOOL import_public_key_impl(const BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
63 DWORD dwPubExp) DECLSPEC_HIDDEN;
64 BOOL export_private_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
65 DWORD *pdwPubExp) DECLSPEC_HIDDEN;
66 BOOL import_private_key_impl(const BYTE* pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
67 DWORD dwDataLen, DWORD dwPubExp) DECLSPEC_HIDDEN;
69 BOOL gen_rand_impl(BYTE *pbBuffer, DWORD dwLen) DECLSPEC_HIDDEN;
71 #endif /* __WINE_IMPLGLUE_H */