1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/* Copyright (C) RSA Data Security, Inc. created 1994, 1996. This is an
unpublished work protected as such under copyright law. This work
contains proprietary, confidential, and trade secret information of
RSA Data Security, Inc. Use, disclosure or reproduction without the
express written authorization of RSA Data Security, Inc. is
prohibited.
*/
#ifndef DNSSAFE_CRT2_H
#define DNSSAFE_CRT2_H 1
#include "bigmaxes.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Note, these are only valid after a call to A_RSA_CRT2Init.
*/
#define A_RSA_CRT2_BLOCK_LEN(context) ((context)->blockLen)
#define A_RSA_CRT2_MAX_OUTPUT_LEN(context, inputLen)\
(inputLen) + (((inputLen) % (context)->blockLen) ?\
(context)->blockLen - ((inputLen) % (context)->blockLen) : 0)
typedef struct {
unsigned int blockLen; /* total size of the block to be computed */
unsigned char input[MAX_RSA_MODULUS_LEN];
unsigned int inputLen;
unsigned int primeWords;
UINT2 modulus[2 * MAX_RSA_PRIME_WORDS];
UINT2 primeP[MAX_RSA_PRIME_WORDS];
UINT2 primeQ[MAX_RSA_PRIME_WORDS];
UINT2 exponentP[MAX_RSA_PRIME_WORDS];
UINT2 exponentQ[MAX_RSA_PRIME_WORDS];
UINT2 coefficient[MAX_RSA_PRIME_WORDS];
} A_RSA_CRT2_CTX;
int A_RSA_CRT2Init PROTO_LIST ((A_RSA_CRT2_CTX *, A_RSA_CRT_KEY *));
int A_RSA_CRT2Update PROTO_LIST
((A_RSA_CRT2_CTX *, unsigned char *, unsigned int *, unsigned int,
unsigned char *, unsigned int, A_SURRENDER_CTX *));
int A_RSA_CRT2Final PROTO_LIST ((A_RSA_CRT2_CTX *));
void A_RSA_CRT2GetMaxOutputLen PROTO_LIST
((A_RSA_CRT2_CTX *, unsigned int *, unsigned int));
#ifdef __cplusplus
}
#endif
#endif /* DNSSAFE_CRT2_H */
|