gphoto2.ds: Set supported groups.
[wine.git] / dlls / rsaenh / implglue.h
blob5353810a0d8cd808923406abbe638bc109b07f35
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 /* Next typedef copied from dlls/advapi32/crypt_md4.c */
33 typedef struct tagMD4_CTX {
34 unsigned int buf[4];
35 unsigned int i[2];
36 unsigned char in[64];
37 unsigned char digest[16];
38 } MD4_CTX;
40 /* Next typedef copied from dlls/advapi32/crypt_md5.c */
41 typedef struct tagMD5_CTX
43 unsigned int i[2];
44 unsigned int buf[4];
45 unsigned char in[64];
46 unsigned char digest[16];
47 } MD5_CTX;
49 /* Next typedef copied form dlls/advapi32/crypt_sha.c */
50 typedef struct tagSHA_CTX
52 ULONG Unknown[6];
53 ULONG State[5];
54 ULONG Count[2];
55 UCHAR Buffer[64];
56 } SHA_CTX, *PSHA_CTX;
58 typedef union tagHASH_CONTEXT {
59 md2_state md2;
60 MD4_CTX md4;
61 MD5_CTX md5;
62 SHA_CTX sha;
63 BCRYPT_HASH_HANDLE bcrypt_hash;
64 } HASH_CONTEXT;
66 typedef union tagKEY_CONTEXT {
67 rc2_key rc2;
68 des_key des;
69 des3_key des3;
70 aes_key aes;
71 prng_state rc4;
72 rsa_key rsa;
73 } KEY_CONTEXT;
75 BOOL init_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext) DECLSPEC_HIDDEN;
76 BOOL update_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, const BYTE *pbData,
77 DWORD dwDataLen) DECLSPEC_HIDDEN;
78 BOOL finalize_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, BYTE *pbHashValue) DECLSPEC_HIDDEN;
79 BOOL duplicate_hash_impl(ALG_ID aiAlgid, const HASH_CONTEXT *pSrcHashContext,
80 HASH_CONTEXT *pDestHashContext) DECLSPEC_HIDDEN;
82 BOOL new_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen) DECLSPEC_HIDDEN;
83 BOOL free_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext) DECLSPEC_HIDDEN;
84 BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
85 DWORD dwEffectiveKeyLen, DWORD dwSaltLen, BYTE *abKeyValue) DECLSPEC_HIDDEN;
86 BOOL duplicate_key_impl(ALG_ID aiAlgid, const KEY_CONTEXT *pSrcKeyContext,
87 KEY_CONTEXT *pDestKeyContext) DECLSPEC_HIDDEN;
89 /* dwKeySpec is optional for symmetric key algorithms */
90 BOOL encrypt_block_impl(ALG_ID aiAlgid, DWORD dwKeySpec, KEY_CONTEXT *pKeyContext, const BYTE *pbIn,
91 BYTE *pbOut, DWORD enc) DECLSPEC_HIDDEN;
92 BOOL encrypt_stream_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, BYTE *pbInOut, DWORD dwLen) DECLSPEC_HIDDEN;
94 BOOL export_public_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
95 DWORD *pdwPubExp) DECLSPEC_HIDDEN;
96 BOOL import_public_key_impl(const BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
97 DWORD dwPubExp) DECLSPEC_HIDDEN;
98 BOOL export_private_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
99 DWORD *pdwPubExp) DECLSPEC_HIDDEN;
100 BOOL import_private_key_impl(const BYTE* pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen,
101 DWORD dwDataLen, DWORD dwPubExp) DECLSPEC_HIDDEN;
103 BOOL gen_rand_impl(BYTE *pbBuffer, DWORD dwLen) DECLSPEC_HIDDEN;
105 #endif /* __WINE_IMPLGLUE_H */