projects
/
crypto_lab3.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Remove useless data from the CRT private key.
[crypto_lab3.git]
/
src
/
RsaCrt.h
1
#ifndef RSACRT_H
2
#define RSACRT_H
3
4
#include <utility>
5
6
#include <gmpxx.h>
7
8
#include
"Rsa.h"
9
10
class
RsaCrt
11
{
12
public
:
13
struct
KeyPriv
{
14
mpz_class p
;
15
mpz_class q
;
16
mpz_class dp
;
17
mpz_class dq
;
18
mpz_class qInv
;
19
};
20
21
static
std
::
pair
<
Rsa
::
KeyPub
,
KeyPriv
>
generateRSAKeys
(
uint exponent
,
uint keySizeBits
);
22
23
/**
24
* m must not be greater or equal than kPriv.n.
25
*/
26
static
mpz_class
sign
(
const
mpz_class
&
m
,
const
KeyPriv
&
kPriv
);
27
};
28
29
#endif