kernel32/tests: Add a test to check some fields in fake dlls.
[wine.git] / dlls / rsaenh / implglue.h
blob9be642e9b60448ffd8dd0a7264aa42b3859187ec
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 tagHASH_CONTEXT {
33 BCRYPT_HASH_HANDLE bcrypt_hash;
34 } HASH_CONTEXT;
36 typedef union tagKEY_CONTEXT {
37 rc2_key rc2;
38 des_key des;
39 des3_key des3;
40 aes_key aes;
41 prng_state rc4;
42 rsa_key rsa;
43 } KEY_CONTEXT;
45 BOOL init_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext) DECLSPEC_HIDDEN;
46 BOOL update_hash_impl(HASH_CONTEXT *pHashContext, const BYTE *pbData,
47 DWORD dwDataLen) DECLSPEC_HIDDEN;
48 BOOL finalize_hash_impl(HASH_CONTEXT *pHashContext, BYTE *pbHashValue) DECLSPEC_HIDDEN;
49 BOOL duplicate_hash_impl(const HASH_CONTEXT *pSrcHashContext,
50 HASH_CONTEXT *pDestHashContext) DECLSPEC_HIDDEN;
52 BOOL new_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen) DECLSPEC_HIDDEN;
53 BOOL free_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext) DECLSPEC_HIDDEN;
54 BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
55 DWORD dwEffectiveKeyLen, DWORD dwSaltLen, BYTE *abKeyValue) DECLSPEC_HIDDEN;
56 BOOL duplicate_key_impl(ALG_ID aiAlgid, const KEY_CONTEXT *pSrcKeyContext,
57 KEY_CONTEXT *pDestKeyContext) DECLSPEC_HIDDEN;
59 /* dwKeySpec is optional for symmetric key algorithms */
60 BOOL encrypt_block_impl(ALG_ID aiAlgid, DWORD dwKeySpec, KEY_CONTEXT *pKeyContext, const BYTE *pbIn,
61 BYTE *pbOut, DWORD enc) DECLSPEC_HIDDEN;
62 BOOL encrypt_stream_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, BYTE *pbInOut, DWORD dwLen) DECLSPEC_HIDDEN;
64 BOOL export_public_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
65 DWORD *pdwPubExp) DECLSPEC_HIDDEN;
66 BOOL import_public_key_impl(const BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
67 DWORD dwPubExp) DECLSPEC_HIDDEN;
68 BOOL export_private_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
69 DWORD *pdwPubExp) DECLSPEC_HIDDEN;
70 BOOL import_private_key_impl(const BYTE* pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
71 DWORD dwDataLen, DWORD dwPubExp) DECLSPEC_HIDDEN;
73 BOOL gen_rand_impl(BYTE *pbBuffer, DWORD dwLen) DECLSPEC_HIDDEN;
75 #endif /* __WINE_IMPLGLUE_H */