ReactOS 0.4.17-dev-1190-g4c812f4
implglue.c File Reference
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "ntsecapi.h"
#include "wincrypt.h"
#include "implglue.h"
Include dependency graph for implglue.c:

Go to the source code of this file.

Functions

 SYMCRYPT_ENVIRONMENT_DEFS (WindowsUsermodeWin8_1nLater)
 
void *SYMCRYPT_CALL SymCryptCallbackAlloc (SIZE_T size)
 
void SYMCRYPT_CALL SymCryptCallbackFree (void *ptr)
 
void SYMCRYPT_CALL SymCryptRsaSelftest (void)
 
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptRsaSignVerifyPct (const SYMCRYPT_RSAKEY *key)
 
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptCallbackRandom (BYTE *buf, SIZE_T size)
 
BOOL init_hash_impl (ALG_ID algid, struct hash *hash)
 
static SYMCRYPT_RSAKEY * alloc_rsa_key (DWORD bitlen, BOOL private)
 
BOOL new_key_impl (ALG_ID algid, KEY_CONTEXT *ctx, DWORD keylen)
 
BOOL free_key_impl (ALG_ID algid, KEY_CONTEXT *ctx)
 
BOOL setup_key_impl (ALG_ID algid, KEY_CONTEXT *ctx, DWORD keylen, DWORD effective_keylen, DWORD saltlen, const BYTE *secret)
 
BOOL duplicate_key_impl (ALG_ID algid, const KEY_CONTEXT *src, KEY_CONTEXT *dst)
 
static BOOL verify_input (const SYMCRYPT_RSAKEY *key, const BYTE *src, SIZE_T src_size, SYMCRYPT_NUMBER_FORMAT format, BYTE *scratch, SIZE_T scratch_size)
 
static BOOL rsa_encrypt (const SYMCRYPT_RSAKEY *key, const BYTE *in, SYMCRYPT_NUMBER_FORMAT in_format, BYTE *out, SYMCRYPT_NUMBER_FORMAT out_format)
 
BOOL encrypt_block_impl (ALG_ID algid, KEY_CONTEXT *ctx, const BYTE *in, BYTE *out)
 
static BOOL rsa_decrypt (const SYMCRYPT_RSAKEY *key, const BYTE *in, SYMCRYPT_NUMBER_FORMAT in_format, BYTE *out, SYMCRYPT_NUMBER_FORMAT out_format)
 
BOOL decrypt_block_impl (ALG_ID algid, KEY_CONTEXT *ctx, const BYTE *in, BYTE *out)
 
BOOL sign_hash_impl (KEY_CONTEXT *ctx, const BYTE *in, BYTE *out)
 
BOOL verify_signature_impl (KEY_CONTEXT *ctx, const BYTE *in, BYTE *out)
 
BOOL encrypt_stream_impl (ALG_ID algid, KEY_CONTEXT *ctx, BYTE *stream, DWORD len)
 
BOOL export_public_key_impl (const KEY_CONTEXT *ctx, BYTE *dst, DWORD *pubexp)
 
BOOL import_public_key_impl (ALG_ID algid, const BYTE *src, DWORD keylen, DWORD pubexp, KEY_CONTEXT *ctx)
 
BOOL export_private_key_impl (const KEY_CONTEXT *ctx, BYTE *dst, DWORD *pubexp)
 
BOOL import_private_key_impl (ALG_ID algid, const BYTE *src, DWORD keylen, DWORD pubexp, KEY_CONTEXT *ctx)
 

Variables

UINT32 g_SymCryptFipsSelftestsPerformed
 

Function Documentation

◆ alloc_rsa_key()

static SYMCRYPT_RSAKEY * alloc_rsa_key ( DWORD  bitlen,
BOOL  private 
)
static

Definition at line 84 of file implglue.c.

85{
87
88 params.version = 1;
89 params.nBitsOfModulus = bitlen;
90 params.nPrimes = private ? 2 : 0;
91 params.nPubExp = 1;
92 return SymCryptRsakeyAllocate( &params, 0 );
93}
GLenum const GLfloat * params
Definition: glext.h:5645
PSYMCRYPT_RSAKEY SYMCRYPT_CALL SymCryptRsakeyAllocate(_In_ PCSYMCRYPT_RSA_PARAMS pParams, _In_ UINT32 flags)
Definition: rsakey.c:13

Referenced by duplicate_key_impl(), import_private_key_impl(), import_public_key_impl(), and new_key_impl().

◆ decrypt_block_impl()

BOOL decrypt_block_impl ( ALG_ID  algid,
KEY_CONTEXT *  ctx,
const BYTE *  in,
BYTE *  out 
)

Definition at line 395 of file implglue.c.

396{
397 switch (algid)
398 {
399 case CALG_RC2:
400 SymCryptRc2Decrypt( &ctx->rc2, in, out );
401 break;
402 case CALG_3DES:
403 case CALG_3DES_112:
404 SymCrypt3DesDecrypt( &ctx->des3, in, out );
405 break;
406 case CALG_DES:
407 SymCryptDesDecrypt( &ctx->des, in, out );
408 break;
409 case CALG_AES:
410 case CALG_AES_128:
411 case CALG_AES_192:
412 case CALG_AES_256:
413 SymCryptAesDecrypt( &ctx->aes, in, out );
414 break;
415 case CALG_RSA_KEYX:
416 case CALG_RSA_SIGN:
417 case CALG_SSL3_SHAMD5:
419 default:
421 return FALSE;
422 }
423 return TRUE;
424}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define SetLastError(x)
Definition: compat.h:752
GLuint in
Definition: glext.h:9616
static BOOL rsa_decrypt(const SYMCRYPT_RSAKEY *key, const BYTE *in, SYMCRYPT_NUMBER_FORMAT in_format, BYTE *out, SYMCRYPT_NUMBER_FORMAT out_format)
Definition: implglue.c:332
algid
VOID SYMCRYPT_CALL SymCryptAesDecrypt(_In_ PCSYMCRYPT_AES_EXPANDED_KEY pExpandedKey, _In_reads_(SYMCRYPT_AES_BLOCK_SIZE) PCBYTE pbSrc, _Out_writes_(SYMCRYPT_AES_BLOCK_SIZE) PBYTE pbDst)
Definition: aes-default.c:134
VOID SYMCRYPT_CALL SymCryptRc2Decrypt(_In_ PCSYMCRYPT_RC2_EXPANDED_KEY pExpandedKey, _In_reads_(SYMCRYPT_RC2_BLOCK_SIZE) PCBYTE pbSrc, _Out_writes_(SYMCRYPT_RC2_BLOCK_SIZE) PBYTE pbDst)
Definition: rc2.c:330
VOID SYMCRYPT_CALL SymCryptDesDecrypt(_In_ PCSYMCRYPT_DES_EXPANDED_KEY pExpandedKey, _In_reads_(SYMCRYPT_DES_BLOCK_SIZE) PCBYTE pbSrc, _Out_writes_(SYMCRYPT_DES_BLOCK_SIZE) PBYTE pbDst)
Definition: 3des.c:152
@ SYMCRYPT_NUMBER_FORMAT_MSB_FIRST
Definition: symcrypt.h:7017
@ SYMCRYPT_NUMBER_FORMAT_LSB_FIRST
Definition: symcrypt.h:7016
VOID SYMCRYPT_CALL SymCrypt3DesDecrypt(_In_ PCSYMCRYPT_3DES_EXPANDED_KEY pExpandedKey, _In_reads_(SYMCRYPT_3DES_BLOCK_SIZE) PCBYTE pbSrc, _Out_writes_(SYMCRYPT_3DES_BLOCK_SIZE) PBYTE pbDst)
Definition: 3des.c:478
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define CALG_RC2
Definition: wincrypt.h:2083
#define CALG_AES_128
Definition: wincrypt.h:2087
#define CALG_AES_192
Definition: wincrypt.h:2088
#define CALG_RSA_SIGN
Definition: wincrypt.h:2069
#define CALG_3DES_112
Definition: wincrypt.h:2085
#define CALG_AES
Definition: wincrypt.h:2090
#define CALG_RSA_KEYX
Definition: wincrypt.h:2080
#define CALG_AES_256
Definition: wincrypt.h:2089
#define CALG_3DES
Definition: wincrypt.h:2084
#define CALG_SSL3_SHAMD5
Definition: wincrypt.h:2062
#define CALG_DES
Definition: wincrypt.h:2082
#define NTE_BAD_ALGID
Definition: winerror.h:4255

Referenced by import_symmetric_key(), and RSAENH_CPDecrypt().

◆ duplicate_key_impl()

BOOL duplicate_key_impl ( ALG_ID  algid,
const KEY_CONTEXT *  src,
KEY_CONTEXT *  dst 
)

Definition at line 183 of file implglue.c.

184{
185 switch (algid)
186 {
187 case CALG_RC4:
188 case CALG_RC2:
189 case CALG_3DES:
190 case CALG_3DES_112:
191 case CALG_DES:
192 *dst = *src;
193 break;
194 case CALG_AES:
195 case CALG_AES_128:
196 case CALG_AES_192:
197 case CALG_AES_256:
198 /* SYMCRYPT_AES_EXPANDED_KEY contains pointers into its own RoundKey
199 * array, so it cannot be copied by assignment. */
200 SymCryptAesKeyCopy( &src->aes, &dst->aes );
201 break;
202 case CALG_RSA_KEYX:
203 case CALG_RSA_SIGN:
204 {
205 BYTE *blob;
206 DWORD pubexp, keylen = SymCryptRsakeySizeofModulus( src->rsa.key );
207 BOOLEAN private = SymCryptRsakeyHasPrivateKey( src->rsa.key );
208
209 if (!(dst->rsa.key = alloc_rsa_key( keylen * 8, private )) || !(blob = malloc( keylen * 2 )))
210 {
212 return FALSE;
213 }
214 if (private)
215 {
216 if (!export_private_key_impl( src, blob, &pubexp ) ||
217 !import_private_key_impl( algid, blob, keylen, pubexp, dst ))
218 {
219 free( blob );
220 return FALSE;
221 }
222 }
223 else
224 {
225 if (!export_public_key_impl( src, blob, &pubexp ) ||
226 !import_public_key_impl( algid, blob, keylen, pubexp, dst ))
227 {
228 free( blob );
229 return FALSE;
230 }
231 }
232 dst->rsa.flags = src->rsa.flags;
233 free( blob );
234 break;
235 }
236 default:
238 return FALSE;
239 }
240 return TRUE;
241}
unsigned char BOOLEAN
Definition: actypes.h:127
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
BOOL import_public_key_impl(ALG_ID algid, const BYTE *src, DWORD keylen, DWORD pubexp, KEY_CONTEXT *ctx)
Definition: implglue.c:470
BOOL export_public_key_impl(const KEY_CONTEXT *ctx, BYTE *dst, DWORD *pubexp)
Definition: implglue.c:450
BOOL import_private_key_impl(ALG_ID algid, const BYTE *src, DWORD keylen, DWORD pubexp, KEY_CONTEXT *ctx)
Definition: implglue.c:533
BOOL export_private_key_impl(const KEY_CONTEXT *ctx, BYTE *dst, DWORD *pubexp)
Definition: implglue.c:493
static SYMCRYPT_RSAKEY * alloc_rsa_key(DWORD bitlen, BOOL private)
Definition: implglue.c:84
Definition: image.c:229
UINT32 SYMCRYPT_CALL SymCryptRsakeySizeofModulus(_In_ PCSYMCRYPT_RSAKEY pkRsakey)
Definition: rsakey.c:264
BOOLEAN SYMCRYPT_CALL SymCryptRsakeyHasPrivateKey(_In_ PCSYMCRYPT_RSAKEY pkRsakey)
Definition: rsakey.c:257
VOID SYMCRYPT_CALL SymCryptAesKeyCopy(_In_ PCSYMCRYPT_AES_EXPANDED_KEY pSrc, _Out_ PSYMCRYPT_AES_EXPANDED_KEY pDst)
Definition: aes-key.c:240
#define CALG_RC4
Definition: wincrypt.h:2091
#define NTE_FAIL
Definition: winerror.h:4279
unsigned char BYTE
Definition: xxhash.c:193

Referenced by RSAENH_CPCreateHash(), and RSAENH_CPDuplicateKey().

◆ encrypt_block_impl()

BOOL encrypt_block_impl ( ALG_ID  algid,
KEY_CONTEXT *  ctx,
const BYTE *  in,
BYTE *  out 
)

Definition at line 301 of file implglue.c.

302{
303 switch (algid)
304 {
305 case CALG_RC2:
306 SymCryptRc2Encrypt( &ctx->rc2, in, out );
307 break;
308 case CALG_3DES:
309 case CALG_3DES_112:
310 SymCrypt3DesEncrypt( &ctx->des3, in, out );
311 break;
312 case CALG_DES:
313 SymCryptDesEncrypt( &ctx->des, in, out );
314 break;
315 case CALG_AES:
316 case CALG_AES_128:
317 case CALG_AES_192:
318 case CALG_AES_256:
319 SymCryptAesEncrypt( &ctx->aes, in, out );
320 break;
321 case CALG_RSA_KEYX:
322 case CALG_RSA_SIGN:
323 case CALG_SSL3_SHAMD5:
325 default:
327 return FALSE;
328 }
329 return TRUE;
330}
static BOOL rsa_encrypt(const SYMCRYPT_RSAKEY *key, const BYTE *in, SYMCRYPT_NUMBER_FORMAT in_format, BYTE *out, SYMCRYPT_NUMBER_FORMAT out_format)
Definition: implglue.c:263
VOID SYMCRYPT_CALL SymCryptDesEncrypt(_In_ PCSYMCRYPT_DES_EXPANDED_KEY pExpandedKey, _In_reads_(SYMCRYPT_DES_BLOCK_SIZE) PCBYTE pbSrc, _Out_writes_(SYMCRYPT_DES_BLOCK_SIZE) PBYTE pbDst)
Definition: 3des.c:142
VOID SYMCRYPT_CALL SymCryptRc2Encrypt(_In_ PCSYMCRYPT_RC2_EXPANDED_KEY pExpandedKey, _In_reads_(SYMCRYPT_RC2_BLOCK_SIZE) PCBYTE pbSrc, _Out_writes_(SYMCRYPT_RC2_BLOCK_SIZE) PBYTE pbDst)
Definition: rc2.c:234
VOID SYMCRYPT_CALL SymCryptAesEncrypt(_In_ PCSYMCRYPT_AES_EXPANDED_KEY pExpandedKey, _In_reads_(SYMCRYPT_AES_BLOCK_SIZE) PCBYTE pbSrc, _Out_writes_(SYMCRYPT_AES_BLOCK_SIZE) PBYTE pbDst)
Definition: aes-default.c:95
VOID SYMCRYPT_CALL SymCrypt3DesEncrypt(_In_ PCSYMCRYPT_3DES_EXPANDED_KEY pExpandedKey, _In_reads_(SYMCRYPT_3DES_BLOCK_SIZE) PCBYTE pbSrc, _Out_writes_(SYMCRYPT_3DES_BLOCK_SIZE) PBYTE pbDst)
Definition: 3des.c:358

Referenced by block_encrypt(), crypt_export_simple(), RSAENH_CPDecrypt(), and RSAENH_CPEncrypt().

◆ encrypt_stream_impl()

BOOL encrypt_stream_impl ( ALG_ID  algid,
KEY_CONTEXT *  ctx,
BYTE *  stream,
DWORD  len 
)

Definition at line 436 of file implglue.c.

437{
438 switch (algid)
439 {
440 case CALG_RC4:
442 break;
443 default:
445 return FALSE;
446 }
447 return TRUE;
448}
GLenum GLsizei len
Definition: glext.h:6722
Definition: parse.h:23
VOID SYMCRYPT_CALL SymCryptRc4Crypt(_Inout_ PSYMCRYPT_RC4_STATE pState, _In_reads_(cbData) PCBYTE pbSrc, _Out_writes_(cbData) PBYTE pbDst, _In_ SIZE_T cbData)
Definition: rc4.c:82

Referenced by RSAENH_CPDecrypt(), and RSAENH_CPEncrypt().

◆ export_private_key_impl()

BOOL export_private_key_impl ( const KEY_CONTEXT *  ctx,
BYTE *  dst,
DWORD *  pubexp 
)

Definition at line 493 of file implglue.c.

494{
495 BYTE *modulus, *primes[2], *exponents[2], *coefficient, *private_exp;
496 SIZE_T modulus_size, primes_sizes[2];
497 UINT64 pubexp64;
498
499 if (!ctx->rsa.key) return FALSE;
500
501 modulus_size = SymCryptRsakeySizeofModulus( ctx->rsa.key );
502
503 primes_sizes[0] = SymCryptRsakeySizeofPrime( ctx->rsa.key, 0 );
504 primes_sizes[1] = SymCryptRsakeySizeofPrime( ctx->rsa.key, 1 );
505
506 modulus = dst;
507 primes[0] = modulus + modulus_size;
508 primes[1] = modulus + modulus_size + primes_sizes[0];
509
510 if (SymCryptRsakeyGetValue( ctx->rsa.key, modulus, modulus_size, &pubexp64, 1, primes, primes_sizes, 2,
512 {
514 return FALSE;
515 }
516
517 exponents[0] = primes[1] + primes_sizes[1];
518 exponents[1] = exponents[0] + primes_sizes[0];
519 coefficient = exponents[1] + primes_sizes[1];
520 private_exp = coefficient + primes_sizes[0];
521
522 if (SymCryptRsakeyGetCrtValue( ctx->rsa.key, exponents, primes_sizes, 2, coefficient, primes_sizes[0],
524 {
526 return FALSE;
527 }
528
529 *pubexp = pubexp64;
530 return TRUE;
531}
COMPILER_DEPENDENT_UINT64 UINT64
Definition: actypes.h:131
BYTE private_exp[512/8]
Definition: bcrypt.c:2643
BYTE coefficient[512/16]
Definition: bcrypt.c:2642
UINT32 SYMCRYPT_CALL SymCryptRsakeySizeofPrime(_In_ PCSYMCRYPT_RSAKEY pkRsakey, UINT32 index)
Definition: rsakey.c:289
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptRsakeyGetValue(_In_ PCSYMCRYPT_RSAKEY pkRsakey, _Out_writes_bytes_(cbModulus) PBYTE pbModulus, SIZE_T cbModulus, _Out_writes_opt_(nPubExp) PUINT64 pu64PubExp, UINT32 nPubExp, _Out_writes_opt_(nPrimes) PBYTE *ppPrimes, _In_reads_opt_(nPrimes) SIZE_T *pcbPrimes, UINT32 nPrimes, SYMCRYPT_NUMBER_FORMAT numFormat, UINT32 flags)
Definition: rsakey.c:1445
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptRsakeyGetCrtValue(_In_ PCSYMCRYPT_RSAKEY pkRsakey, _Out_writes_opt_(nCrtExponents) PBYTE *ppCrtExponents, _In_reads_(nCrtExponents) SIZE_T *pcbCrtExponents, UINT32 nCrtExponents, _Out_writes_bytes_opt_(cbCrtCoefficient) PBYTE pbCrtCoefficient, SIZE_T cbCrtCoefficient, _Out_writes_bytes_opt_(cbPrivateExponent) PBYTE pbPrivateExponent, SIZE_T cbPrivateExponent, SYMCRYPT_NUMBER_FORMAT numFormat, UINT32 flags)
Definition: rsakey.c:1518
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by crypt_export_private_key(), and duplicate_key_impl().

◆ export_public_key_impl()

BOOL export_public_key_impl ( const KEY_CONTEXT *  ctx,
BYTE *  dst,
DWORD *  pubexp 
)

Definition at line 450 of file implglue.c.

451{
452 BYTE *modulus = dst;
453 SIZE_T modulus_size;
454 UINT64 pubexp64;
455
456 if (!ctx->rsa.key) return FALSE;
457
458 modulus_size = SymCryptRsakeySizeofModulus( ctx->rsa.key );
459
460 if (SymCryptRsakeyGetValue( ctx->rsa.key, modulus, modulus_size, &pubexp64, 1, NULL, NULL, 0,
462 {
464 return FALSE;
465 }
466 *pubexp = pubexp64;
467 return TRUE;
468}
#define NULL
Definition: types.h:112

Referenced by crypt_export_public_key(), and duplicate_key_impl().

◆ free_key_impl()

BOOL free_key_impl ( ALG_ID  algid,
KEY_CONTEXT *  ctx 
)

Definition at line 129 of file implglue.c.

130{
131 switch (algid)
132 {
133 case CALG_RSA_KEYX:
134 case CALG_RSA_SIGN:
135 if (ctx->rsa.key)
136 {
137 SymCryptRsakeyFree( ctx->rsa.key );
138 ctx->rsa.key = NULL;
139 }
140 break;
141 default:
142 break;
143 }
144 return TRUE;
145}
VOID SYMCRYPT_CALL SymCryptRsakeyFree(_Out_ PSYMCRYPT_RSAKEY pkObj)
Definition: rsakey.c:42

Referenced by destroy_hash(), and destroy_key().

◆ import_private_key_impl()

BOOL import_private_key_impl ( ALG_ID  algid,
const BYTE *  src,
DWORD  keylen,
DWORD  pubexp,
KEY_CONTEXT *  ctx 
)

Definition at line 533 of file implglue.c.

534{
535 const BYTE *modulus = src, *primes[2];
536 SIZE_T primes_sizes[2];
537 UINT64 exp64 = pubexp;
538
539 ctx->rsa.flags = SYMCRYPT_FLAG_KEY_NO_FIPS;
542
543 if (!(ctx->rsa.key = alloc_rsa_key( keylen * 8, TRUE )))
544 {
546 return FALSE;
547 }
548
549 primes[0] = modulus + keylen;
550 primes[1] = primes[0] + keylen / 2;
551
552 primes_sizes[0] = keylen / 2;
553 primes_sizes[1] = keylen / 2;
554
555 if (SymCryptRsakeySetValue( modulus, keylen, &exp64, 1, primes, primes_sizes, 2,
556 SYMCRYPT_NUMBER_FORMAT_LSB_FIRST, ctx->rsa.flags, ctx->rsa.key ))
557 {
559 return FALSE;
560 }
561
562 return TRUE;
563}
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptRsakeySetValue(_In_reads_bytes_(cbModulus) PCBYTE pbModulus, SIZE_T cbModulus, _In_reads_(nPubExp) PCUINT64 pu64PubExp, UINT32 nPubExp, _In_reads_opt_(nPrimes) PCBYTE *ppPrimes, _In_reads_opt_(nPrimes) SIZE_T *pcbPrimes, UINT32 nPrimes, SYMCRYPT_NUMBER_FORMAT numFormat, UINT32 flags, _Inout_ PSYMCRYPT_RSAKEY pkRsakey)
Definition: rsakey.c:1399
#define SYMCRYPT_FLAG_RSAKEY_SIGN
Definition: symcrypt.h:7598
#define SYMCRYPT_FLAG_RSAKEY_ENCRYPT
Definition: symcrypt.h:7599
#define SYMCRYPT_FLAG_KEY_NO_FIPS
Definition: symcrypt.h:7579

Referenced by duplicate_key_impl(), and import_private_key().

◆ import_public_key_impl()

BOOL import_public_key_impl ( ALG_ID  algid,
const BYTE *  src,
DWORD  keylen,
DWORD  pubexp,
KEY_CONTEXT *  ctx 
)

Definition at line 470 of file implglue.c.

471{
472 const BYTE *modulus = src;
473 UINT64 exp64 = pubexp;
474
475 ctx->rsa.flags = SYMCRYPT_FLAG_KEY_NO_FIPS;
478
479 if (!(ctx->rsa.key = alloc_rsa_key( keylen * 8, FALSE )))
480 {
482 return FALSE;
483 }
485 ctx->rsa.flags, ctx->rsa.key ))
486 {
488 return FALSE;
489 }
490 return TRUE;
491}

Referenced by duplicate_key_impl(), and import_public_key().

◆ init_hash_impl()

BOOL init_hash_impl ( ALG_ID  algid,
struct hash *  hash 
)

Definition at line 63 of file implglue.c.

64{
65 const SYMCRYPT_HASH *algorithms[] =
66 {
74 };
75
76 memset( hash, 0, sizeof(*hash) );
77 if (GET_ALG_CLASS(algid) != ALG_CLASS_HASH) return TRUE;
78 if (GET_ALG_SID(algid) >= ARRAY_SIZE(algorithms)) return TRUE;
79 if (!(hash->desc = algorithms[GET_ALG_SID(algid)])) return TRUE;
81 return TRUE;
82}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define memset(x, y, z)
Definition: compat.h:39
SYMCRYPT_HASH_STATE state
Definition: bcrypt_main.c:112
const SYMCRYPT_HASH * desc
Definition: bcrypt_main.c:111
const PCSYMCRYPT_HASH SymCryptSha256Algorithm
Definition: sha256.c:46
VOID SYMCRYPT_CALL SymCryptHashInit(_In_ PCSYMCRYPT_HASH pHash, _Out_writes_bytes_(pHash->stateSize) PVOID pState)
Definition: hash.c:173
const PCSYMCRYPT_HASH SymCryptSha1Algorithm
Definition: sha1.c:29
const PCSYMCRYPT_HASH SymCryptMd2Algorithm
Definition: md2.c:40
const PCSYMCRYPT_HASH SymCryptMd5Algorithm
Definition: md5.c:43
const PCSYMCRYPT_HASH SymCryptSha512Algorithm
Definition: sha512.c:170
const PCSYMCRYPT_HASH SymCryptSha384Algorithm
Definition: sha512.c:169
const PCSYMCRYPT_HASH SymCryptMd4Algorithm
Definition: md4.c:46
struct _SYMCRYPT_HASH SYMCRYPT_HASH
#define ALG_SID_MD4
Definition: wincrypt.h:2029
#define ALG_SID_MD2
Definition: wincrypt.h:2028
#define ALG_SID_SHA_512
Definition: wincrypt.h:2042
#define GET_ALG_SID(x)
Definition: wincrypt.h:1964
#define ALG_CLASS_HASH
Definition: wincrypt.h:1971
#define ALG_SID_SHA_384
Definition: wincrypt.h:2041
#define ALG_SID_MD5
Definition: wincrypt.h:2030
#define ALG_SID_SHA_256
Definition: wincrypt.h:2040
#define ALG_SID_SHA
Definition: wincrypt.h:2031
#define GET_ALG_CLASS(x)
Definition: wincrypt.h:1962

Referenced by finalize_hash(), init_hash(), and RSAENH_CPSetHashParam().

◆ new_key_impl()

BOOL new_key_impl ( ALG_ID  algid,
KEY_CONTEXT *  ctx,
DWORD  keylen 
)

Definition at line 95 of file implglue.c.

96{
97 switch (algid)
98 {
99 case CALG_RSA_KEYX:
100 case CALG_RSA_SIGN:
101 {
102 UINT64 pubexp = 65537;
103
104 ctx->rsa.flags = SYMCRYPT_FLAG_KEY_NO_FIPS;
106 else ctx->rsa.flags |= SYMCRYPT_FLAG_RSAKEY_SIGN;
107
108 if (!(ctx->rsa.key = alloc_rsa_key( keylen * 8, TRUE )))
109 {
111 return FALSE;
112 }
113 if (SymCryptRsakeyGenerate( ctx->rsa.key, &pubexp, 1, ctx->rsa.flags ))
114 {
115 SymCryptRsakeyFree( ctx->rsa.key );
116 ctx->rsa.key = NULL;
118 return FALSE;
119 }
120 break;
121 }
122 default:
124 return FALSE;
125 }
126 return TRUE;
127}
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptRsakeyGenerate(_Inout_ PSYMCRYPT_RSAKEY pkRsakey, _In_reads_opt_(nPubExp) PCUINT64 pu64PubExp, UINT32 nPubExp, _In_ UINT32 flags)
Definition: rsakey.c:514

Referenced by RSAENH_CPGenKey().

◆ rsa_decrypt()

static BOOL rsa_decrypt ( const SYMCRYPT_RSAKEY *  key,
const BYTE *  in,
SYMCRYPT_NUMBER_FORMAT  in_format,
BYTE *  out,
SYMCRYPT_NUMBER_FORMAT  out_format 
)
static

Definition at line 332 of file implglue.c.

334{
335 SIZE_T scratch_size, offset = 0, int_size, tmp_size, key_size = SymCryptRsakeySizeofModulus( key );
336 SYMCRYPT_INT *ciphertext, *plaintext, *tmp;
338 BYTE *scratch;
339 UINT32 i, crt_element_total = 0, crt_elements_size[SYMCRYPT_RSAKEY_MAX_NUMOF_PRIMES];
340
341 int_size = SymCryptSizeofIntFromDigits( key->nDigitsOfModulus );
342 tmp_size = SymCryptSizeofIntFromDigits( key->nMaxDigitsOfPrimes );
343
344 for (i = 0; i < key->nPrimes; i++)
345 {
346 crt_elements_size[i] = SYMCRYPT_SIZEOF_MODELEMENT_FROM_BITS( key->nBitsOfPrimes[i] );
347 crt_element_total += crt_elements_size[i];
348 }
349
350 scratch_size = 3 * int_size + tmp_size + crt_element_total +
353 SYMCRYPT_MAX( SYMCRYPT_SCRATCH_BYTES_FOR_INT_DIVMOD( key->nDigitsOfModulus, key->nMaxDigitsOfPrimes ),
354 SYMCRYPT_SCRATCH_BYTES_FOR_CRT_SOLUTION( key->nMaxDigitsOfPrimes ) ) ) );
355
356 if (!(scratch = malloc( scratch_size ))) return FALSE;
357
358 ciphertext = SymCryptIntCreate( scratch, int_size, key->nDigitsOfModulus );
359 offset += int_size;
360
361 plaintext = SymCryptIntCreate( scratch + offset, int_size, key->nDigitsOfModulus );
362 offset += int_size;
363
364 tmp = SymCryptIntCreate( scratch + offset, tmp_size, key->nMaxDigitsOfPrimes );
365 offset += tmp_size;
366
367 for (i = 0; i < key->nPrimes; i++)
368 {
369 crt_elements[i] = SymCryptModElementCreate( scratch + offset, crt_elements_size[i], key->pmPrimes[i] );
370 offset += crt_elements_size[i];
371 }
372
373 SymCryptIntSetValue( in, key_size, in_format, ciphertext );
374
375 for (i = 0; i < key->nPrimes; i++)
376 {
377 SymCryptIntDivMod( ciphertext, SymCryptDivisorFromModulus(key->pmPrimes[i]), NULL, tmp, scratch + offset,
378 scratch_size - offset );
379
380 SymCryptIntToModElement( tmp, key->pmPrimes[i], crt_elements[i], scratch + offset, scratch_size - offset );
381
382 SymCryptModExp( key->pmPrimes[i], crt_elements[i], key->piCrtPrivExps[i], key->nBitsOfPrimes[i], 0,
383 crt_elements[i], scratch + offset, scratch_size - offset );
384 }
385
386 SymCryptCrtSolve( key->nPrimes, (const SYMCRYPT_MODULUS **)key->pmPrimes,
387 (SYMCRYPT_MODELEMENT **)key->peCrtInverses, crt_elements, 0, plaintext, scratch + offset,
388 scratch_size - offset );
389
390 SymCryptIntGetValue( plaintext, out, key_size, out_format );
391 free( scratch );
392 return TRUE;
393}
GLintptr offset
Definition: glext.h:5920
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: copy.c:22
#define SYMCRYPT_RSAKEY_MAX_NUMOF_PRIMES
struct _SYMCRYPT_INT SYMCRYPT_INT
#define SYMCRYPT_MAX(_a, _b)
struct _SYMCRYPT_MODELEMENT SYMCRYPT_MODELEMENT
struct _SYMCRYPT_MODULUS SYMCRYPT_MODULUS
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptCrtSolve(UINT32 nCoprimes, _In_reads_(nCoprimes) PCSYMCRYPT_MODULUS *ppmCoprimes, _In_reads_(nCoprimes) PCSYMCRYPT_MODELEMENT *ppeCrtInverses, _In_reads_(nCoprimes) PCSYMCRYPT_MODELEMENT *ppeCrtRemainders, UINT32 flags, _Out_ PSYMCRYPT_INT piSolution, _Out_writes_bytes_(cbScratch) PBYTE pbScratch, SIZE_T cbScratch)
Definition: crt.c:123
VOID SYMCRYPT_CALL SymCryptIntToModElement(_In_ PCSYMCRYPT_INT piSrc, _In_ PCSYMCRYPT_MODULUS pmMod, _Out_ PSYMCRYPT_MODELEMENT peDst, _Out_writes_bytes_(cbScratch) PBYTE pbScratch, SIZE_T cbScratch)
Definition: a_dispatch.c:749
PSYMCRYPT_DIVISOR SYMCRYPT_CALL SymCryptDivisorFromModulus(_In_ PSYMCRYPT_MODULUS pmSrc)
Definition: a_dispatch.c:703
#define SYMCRYPT_SCRATCH_BYTES_FOR_INT_DIVMOD(_nSrcDigits, _nDivisorDigits)
#define SYMCRYPT_SCRATCH_BYTES_FOR_CRT_SOLUTION(_nDigits)
#define SYMCRYPT_SIZEOF_MODELEMENT_FROM_BITS(_bitsize)
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptIntSetValue(_In_reads_bytes_(cbSrc) PCBYTE pbSrc, SIZE_T cbSrc, SYMCRYPT_NUMBER_FORMAT format, _Out_ PSYMCRYPT_INT piDst)
Definition: a_dispatch.c:248
PSYMCRYPT_MODELEMENT SYMCRYPT_CALL SymCryptModElementCreate(_Out_writes_bytes_(cbBuffer) PBYTE pbBuffer, SIZE_T cbBuffer, _In_ PCSYMCRYPT_MODULUS pmMod)
Definition: a_dispatch.c:665
#define SYMCRYPT_SCRATCH_BYTES_FOR_COMMON_MOD_OPERATIONS(_nDigits)
UINT32 SYMCRYPT_CALL SymCryptSizeofIntFromDigits(UINT32 nDigits)
Definition: a_dispatch.c:134
VOID SYMCRYPT_CALL SymCryptModExp(_In_ PCSYMCRYPT_MODULUS pmMod, _In_ PCSYMCRYPT_MODELEMENT peBase, _In_ PCSYMCRYPT_INT piExp, UINT32 nBitsExp, UINT32 flags, _Out_ PSYMCRYPT_MODELEMENT peDst, _Out_writes_bytes_(cbScratch) PBYTE pbScratch, SIZE_T cbScratch)
Definition: a_dispatch.c:961
VOID SYMCRYPT_CALL SymCryptIntDivMod(_In_ PCSYMCRYPT_INT piSrc, _In_ PCSYMCRYPT_DIVISOR pdDivisor, _Out_opt_ PSYMCRYPT_INT piQuotient, _Out_opt_ PSYMCRYPT_INT piRemainder, _Out_writes_bytes_(cbScratch) PBYTE pbScratch, SIZE_T cbScratch)
Definition: a_dispatch.c:573
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptIntGetValue(_In_ PCSYMCRYPT_INT piSrc, _Out_writes_bytes_(cbDst) PBYTE pbDst, SIZE_T cbDst, SYMCRYPT_NUMBER_FORMAT format)
Definition: a_dispatch.c:259
PSYMCRYPT_INT SYMCRYPT_CALL SymCryptIntCreate(_Out_writes_bytes_(cbBuffer) PBYTE pbBuffer, SIZE_T cbBuffer, UINT32 nDigits)
Definition: a_dispatch.c:141
#define SYMCRYPT_SCRATCH_BYTES_FOR_MODEXP(_nDigits)
uint32_t UINT32
Definition: typedefs.h:59

Referenced by decrypt_block_impl(), and sign_hash_impl().

◆ rsa_encrypt()

static BOOL rsa_encrypt ( const SYMCRYPT_RSAKEY *  key,
const BYTE *  in,
SYMCRYPT_NUMBER_FORMAT  in_format,
BYTE *  out,
SYMCRYPT_NUMBER_FORMAT  out_format 
)
static

Definition at line 263 of file implglue.c.

265{
268 SIZE_T scratch_size, mod_size = SymCryptSizeofModElementFromModulus( key->pmModulus );
271 BYTE *scratch;
272
273 scratch_size = SymCryptSizeofModElementFromModulus( key->pmModulus ) +
275 SYMCRYPT_SCRATCH_BYTES_FOR_MODEXP( key->nDigitsOfModulus ) );
276
277 if (!(scratch = malloc( scratch_size ))) return FALSE;
278 if (!verify_input( key, in, key_size, in_format, scratch, scratch_size ))
279 {
280 free( scratch );
281 return FALSE;
282 }
283
284 result = SymCryptModElementCreate( scratch, mod_size, key->pmModulus );
285
286 SymCryptModElementSetValue( in, key_size, in_format, key->pmModulus, result, scratch + mod_size,
287 scratch_size - mod_size );
288
290 SymCryptIntSetValueUint64( key->au64PubExp[0], exp );
291
293 result, scratch + mod_size, scratch_size - mod_size );
294
295 SymCryptModElementGetValue( key->pmModulus, result, out, key_size, out_format, scratch + mod_size,
296 scratch_size - mod_size );
297 free( scratch );
298 return TRUE;
299}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint64EXT * result
Definition: glext.h:11304
static BOOL verify_input(const SYMCRYPT_RSAKEY *key, const BYTE *src, SIZE_T src_size, SYMCRYPT_NUMBER_FORMAT format, BYTE *scratch, SIZE_T scratch_size)
Definition: implglue.c:243
DWORD exp
Definition: msg.c:18625
#define SYMCRYPT_ASYM_ALIGN_VALUE
#define SYMCRYPT_ASYM_ALIGN_UP(_p)
UINT32 SYMCRYPT_CALL SymCryptSizeofModElementFromModulus(PCSYMCRYPT_MODULUS pmMod)
Definition: a_dispatch.c:658
#define SYMCRYPT_SIZEOF_INT_FROM_BITS(_bitsize)
VOID SYMCRYPT_CALL SymCryptIntSetValueUint64(UINT64 u64Src, _Out_ PSYMCRYPT_INT piDst)
Definition: a_dispatch.c:239
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptModElementSetValue(_In_reads_bytes_(cbSrc) PCBYTE pbSrc, SIZE_T cbSrc, SYMCRYPT_NUMBER_FORMAT format, PCSYMCRYPT_MODULUS pmMod, _Out_ PSYMCRYPT_MODELEMENT peDst, _Out_writes_bytes_(cbScratch) PBYTE pbScratch, SIZE_T cbScratch)
Definition: a_dispatch.c:781
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptModElementGetValue(PCSYMCRYPT_MODULUS pmMod, _In_ PCSYMCRYPT_MODELEMENT peSrc, _Out_writes_bytes_(cbDst) PBYTE pbDst, SIZE_T cbDst, SYMCRYPT_NUMBER_FORMAT format, _Out_writes_bytes_(cbScratch) PBYTE pbScratch, SIZE_T cbScratch)
Definition: a_dispatch.c:804
UINT32 SYMCRYPT_CALL SymCryptIntBitsizeOfValue(_In_ PCSYMCRYPT_INT piSrc)
Definition: a_dispatch.c:223
#define SYMCRYPT_FLAG_DATA_PUBLIC

Referenced by encrypt_block_impl(), and verify_signature_impl().

◆ setup_key_impl()

BOOL setup_key_impl ( ALG_ID  algid,
KEY_CONTEXT *  ctx,
DWORD  keylen,
DWORD  effective_keylen,
DWORD  saltlen,
const BYTE *  secret 
)

Definition at line 147 of file implglue.c.

149{
150 switch (algid)
151 {
152 case CALG_RC4:
153 SymCryptRc4Init( &ctx->rc4, secret, keylen + saltlen );
154 break;
155 case CALG_RC2:
156 SymCryptRc2ExpandKeyEx( &ctx->rc2, secret, keylen + saltlen,
157 effective_keylen ? effective_keylen : keylen << 3 );
158 break;
159 case CALG_3DES:
160 SymCrypt3DesExpandKey( &ctx->des3, secret, 24 );
161 break;
162 case CALG_3DES_112:
163 SymCrypt3DesExpandKey( &ctx->des3, secret, 16 );
164 break;
165 case CALG_DES:
166 SymCryptDesExpandKey( &ctx->des, secret, 8 );
167 break;
168 case CALG_AES:
169 case CALG_AES_128:
170 SymCryptAesExpandKey( &ctx->aes, secret, 16 );
171 break;
172 case CALG_AES_192:
173 SymCryptAesExpandKey( &ctx->aes, secret, 24 );
174 break;
175 case CALG_AES_256:
176 SymCryptAesExpandKey( &ctx->aes, secret, 32 );
177 break;
178 }
179
180 return TRUE;
181}
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptDesExpandKey(_Out_ PSYMCRYPT_DES_EXPANDED_KEY pExpandedKey, _In_reads_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
Definition: 3des.c:124
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptAesExpandKey(_Out_ PSYMCRYPT_AES_EXPANDED_KEY pExpandedKey, _In_reads_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
Definition: aes-key.c:219
SYMCRYPT_ERROR SYMCRYPT_CALL SymCrypt3DesExpandKey(_Out_ PSYMCRYPT_3DES_EXPANDED_KEY pExpandedKey, _In_reads_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
Definition: 3des.c:295
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptRc4Init(_Out_ PSYMCRYPT_RC4_STATE pState, _In_reads_(cbKey) PCBYTE pbKey, _In_ SIZE_T cbKey)
Definition: rc4.c:15
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptRc2ExpandKeyEx(_Out_ PSYMCRYPT_RC2_EXPANDED_KEY pExpandedKey, _In_reads_(cbKey) PCBYTE pbKey, SIZE_T cbKey, UINT32 effectiveKeySizeInBits)
Definition: rc2.c:129

Referenced by setup_key().

◆ sign_hash_impl()

BOOL sign_hash_impl ( KEY_CONTEXT *  ctx,
const BYTE *  in,
BYTE *  out 
)

Definition at line 426 of file implglue.c.

Referenced by RSAENH_CPSignHash().

◆ SYMCRYPT_ENVIRONMENT_DEFS()

SYMCRYPT_ENVIRONMENT_DEFS ( WindowsUsermodeWin8_1nLater  )

◆ SymCryptCallbackAlloc()

void *SYMCRYPT_CALL SymCryptCallbackAlloc ( SIZE_T  size)

Definition at line 37 of file implglue.c.

38{
40}
void *CDECL _aligned_malloc(size_t size, size_t alignment)
Definition: heap.c:603
GLsizeiptr size
Definition: glext.h:5919

◆ SymCryptCallbackFree()

void SYMCRYPT_CALL SymCryptCallbackFree ( void *  ptr)

Definition at line 42 of file implglue.c.

43{
45}
void CDECL _aligned_free(void *memblock)
Definition: heap.c:546
static PVOID ptr
Definition: dispmode.c:27

◆ SymCryptCallbackRandom()

SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptCallbackRandom ( BYTE *  buf,
SIZE_T  size 
)

Definition at line 56 of file implglue.c.

57{
58 return RtlGenRandom( buf, size ) ? SYMCRYPT_NO_ERROR : SYMCRYPT_EXTERNAL_FAILURE;
59}
#define RtlGenRandom
Definition: ntsecapi.h:691

◆ SymCryptRsaSelftest()

void SYMCRYPT_CALL SymCryptRsaSelftest ( void  )

Definition at line 47 of file implglue.c.

48{
49}

◆ SymCryptRsaSignVerifyPct()

SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptRsaSignVerifyPct ( const SYMCRYPT_RSAKEY *  key)

Definition at line 51 of file implglue.c.

52{
53 return SYMCRYPT_NO_ERROR;
54}

◆ verify_input()

static BOOL verify_input ( const SYMCRYPT_RSAKEY *  key,
const BYTE *  src,
SIZE_T  src_size,
SYMCRYPT_NUMBER_FORMAT  format,
BYTE *  scratch,
SIZE_T  scratch_size 
)
static

Definition at line 243 of file implglue.c.

245{
246 SYMCRYPT_INT *tmp;
247 UINT32 tmp_size;
248
249 if (src_size > SymCryptRsakeySizeofModulus( key )) return FALSE;
250 if (src_size == SymCryptRsakeySizeofModulus( key ))
251 {
252 tmp_size = SymCryptSizeofIntFromDigits( key->nDigitsOfModulus );
253 SYMCRYPT_ASSERT( scratch_size >= tmp_size );
254 tmp = SymCryptIntCreate( scratch, tmp_size, key->nDigitsOfModulus );
255
256 if (SymCryptIntSetValue( src, src_size, format, tmp )) return FALSE;
257 if (!SymCryptIntIsLessThan( tmp, SymCryptIntFromModulus( key->pmModulus ))) return FALSE;
258 return TRUE;
259 }
260 return FALSE;
261}
#define SYMCRYPT_ASSERT(_x)
Definition: symcrypt.h:10807
UINT32 SYMCRYPT_CALL SymCryptIntIsLessThan(_In_ PCSYMCRYPT_INT piSrc1, _In_ PCSYMCRYPT_INT piSrc2)
Definition: a_dispatch.c:442
PSYMCRYPT_INT SYMCRYPT_CALL SymCryptIntFromModulus(_In_ PSYMCRYPT_MODULUS pmSrc)
Definition: a_dispatch.c:720

Referenced by rsa_encrypt().

◆ verify_signature_impl()

BOOL verify_signature_impl ( KEY_CONTEXT *  ctx,
const BYTE *  in,
BYTE *  out 
)

Definition at line 431 of file implglue.c.

Referenced by RSAENH_CPVerifySignature().

Variable Documentation

◆ g_SymCryptFipsSelftestsPerformed

UINT32 g_SymCryptFipsSelftestsPerformed

Definition at line 61 of file implglue.c.