ReactOS 0.4.17-dev-1133-gc25e4fd
implglue.h
Go to the documentation of this file.
1/*
2 * dlls/rsaenh/implglue.h
3 * Glueing the RSAENH specific code to the crypto library
4 *
5 * Copyright (c) 2004 Michael Jung
6 *
7 * based on code by Mike McCormack and David Hammerton
8 *
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.
13 *
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.
18 *
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
22 */
23
24#ifndef __WINE_IMPLGLUE_H
25#define __WINE_IMPLGLUE_H
26
27#include "symcrypt.h"
28#include "symcrypt_low_level.h"
29
30#define RSAENH_MAX_HASH_SIZE 104
31
32struct rsa_key
33{
36};
37
38typedef union tagKEY_CONTEXT
39{
45 struct rsa_key rsa;
47
48struct hash
49{
50 const SYMCRYPT_HASH *desc;
52};
53
55
56static inline void update_hash_impl(struct hash *hash, const BYTE *data, DWORD len)
57{
59}
60
61static inline void finalize_hash_impl(struct hash *hash, BYTE *hash_value, DWORD hash_size)
62{
63 SymCryptHashResult( hash->desc, &hash->state, hash_value, hash_size );
64}
65
66static inline DWORD hash_len_impl(const struct hash *hash)
67{
69}
70
71static inline DWORD hash_block_len_impl(const struct hash *hash)
72{
74}
75
78BOOL setup_key_impl(ALG_ID algid, KEY_CONTEXT *ctx, DWORD keylen, DWORD effective_keylen, DWORD saltlen,
79 const BYTE *keyvalue);
81
85
88
93
94#endif /* __WINE_IMPLGLUE_H */
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum src
Definition: glext.h:6340
GLuint in
Definition: glext.h:9616
GLenum GLenum dst
Definition: glext.h:6340
GLenum GLsizei len
Definition: glext.h:6722
BOOL import_public_key_impl(ALG_ID algid, const BYTE *src, DWORD keylen, DWORD pubexp, KEY_CONTEXT *ctx)
Definition: implglue.c:470
BOOL new_key_impl(ALG_ID algid, KEY_CONTEXT *ctx, DWORD keylen)
Definition: implglue.c:95
BOOL sign_hash_impl(KEY_CONTEXT *ctx, const BYTE *in, BYTE *out)
Definition: implglue.c:426
BOOL free_key_impl(ALG_ID algid, KEY_CONTEXT *ctx)
Definition: implglue.c:129
BOOL export_public_key_impl(const KEY_CONTEXT *ctx, BYTE *dst, DWORD *pubexp)
Definition: implglue.c:450
static DWORD hash_len_impl(const struct hash *hash)
Definition: implglue.h:66
BOOL duplicate_key_impl(ALG_ID algid, const KEY_CONTEXT *src, KEY_CONTEXT *dst)
Definition: implglue.c:183
BOOL import_private_key_impl(ALG_ID algid, const BYTE *src, DWORD keylen, DWORD pubexp, KEY_CONTEXT *ctx)
Definition: implglue.c:533
BOOL init_hash_impl(ALG_ID algid, struct hash *hash)
Definition: implglue.c:63
BOOL decrypt_block_impl(ALG_ID algid, KEY_CONTEXT *ctx, const BYTE *in, BYTE *out)
Definition: implglue.c:395
BOOL encrypt_block_impl(ALG_ID algid, KEY_CONTEXT *ctx, const BYTE *in, BYTE *out)
Definition: implglue.c:301
BOOL export_private_key_impl(const KEY_CONTEXT *ctx, BYTE *dst, DWORD *pubexp)
Definition: implglue.c:493
union tagKEY_CONTEXT KEY_CONTEXT
BOOL encrypt_stream_impl(ALG_ID algid, KEY_CONTEXT *ctx, BYTE *inout, DWORD len)
Definition: implglue.c:436
BOOL verify_signature_impl(KEY_CONTEXT *ctx, const BYTE *in, BYTE *out)
Definition: implglue.c:431
static void update_hash_impl(struct hash *hash, const BYTE *data, DWORD len)
Definition: implglue.h:56
static void finalize_hash_impl(struct hash *hash, BYTE *hash_value, DWORD hash_size)
Definition: implglue.h:61
static DWORD hash_block_len_impl(const struct hash *hash)
Definition: implglue.h:71
BOOL setup_key_impl(ALG_ID algid, KEY_CONTEXT *ctx, DWORD keylen, DWORD effective_keylen, DWORD saltlen, const BYTE *keyvalue)
Definition: implglue.c:147
algid
SYMCRYPT_HASH_STATE state
Definition: bcrypt_main.c:112
const SYMCRYPT_HASH * desc
Definition: bcrypt_main.c:111
SYMCRYPT_RSAKEY * key
Definition: implglue.h:34
UINT32 flags
Definition: implglue.h:35
SIZE_T SYMCRYPT_CALL SymCryptHashInputBlockSize(_In_ PCSYMCRYPT_HASH pHash)
Definition: hash.c:140
VOID SYMCRYPT_CALL SymCryptHashAppend(_In_ PCSYMCRYPT_HASH pHash, _Inout_updates_bytes_(pHash->stateSize) PVOID pState, _In_reads_(cbData) PCBYTE pbData, SIZE_T cbData)
Definition: hash.c:182
SIZE_T SYMCRYPT_CALL SymCryptHashResultSize(_In_ PCSYMCRYPT_HASH pHash)
Definition: hash.c:132
VOID SYMCRYPT_CALL SymCryptHashResult(_In_ PCSYMCRYPT_HASH pHash, _Inout_updates_bytes_(pHash->stateSize) PVOID pState, _Out_writes_(SYMCRYPT_MIN(cbResult, pHash->resultSize)) PBYTE pbResult, SIZE_T cbResult)
Definition: hash.c:193
struct _SYMCRYPT_HASH SYMCRYPT_HASH
SYMCRYPT_MAGIC_FIELD SYMCRYPT_RSAKEY
SYMCRYPT_MAGIC_FIELD SYMCRYPT_RC4_STATE
SYMCRYPT_DES_EXPANDED_KEY
SYMCRYPT_MAGIC_FIELD SYMCRYPT_3DES_EXPANDED_KEY
SYMCRYPT_MAGIC_FIELD SYMCRYPT_AES_EXPANDED_KEY
SYMCRYPT_MAGIC_FIELD SYMCRYPT_RC2_EXPANDED_KEY
uint32_t UINT32
Definition: typedefs.h:59
SYMCRYPT_3DES_EXPANDED_KEY des3
Definition: implglue.h:41
SYMCRYPT_DES_EXPANDED_KEY des
Definition: implglue.h:40
SYMCRYPT_RC2_EXPANDED_KEY rc2
Definition: implglue.h:42
SYMCRYPT_AES_EXPANDED_KEY aes
Definition: implglue.h:44
struct rsa_key rsa
Definition: implglue.h:45
SYMCRYPT_RC4_STATE rc4
Definition: implglue.h:43
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
unsigned int ALG_ID
Definition: wincrypt.h:54
unsigned char BYTE
Definition: xxhash.c:193