crypt_rsa.h 825 Bytes
Newer Older
1
2
3
4
5
#ifndef __CRYPT_RSA_H
#define __CRYPT_RSA_H

typedef struct
{
6
7
8
9
    unsigned char id;
    char *name;
    char *primefac;
    char *key;
10
11
12
13
14
15
} t_crypt_key;

typedef struct
{
    t_crypt_key pub_key;
    t_crypt_key priv_key;
16
    uint32_t progress;
17
18
} rsa_ctx_t;

g3gg0's avatar
g3gg0 committed
19
20
21
22

t_crypt_key *crypt_rsa_get_priv(crypt_priv_t *priv);
t_crypt_key *crypt_rsa_get_pub(crypt_priv_t *priv);
uint32_t crypt_rsa_get_keysize(crypt_priv_t *priv);
23
uint32_t crypt_rsa_get_keyprogress(crypt_priv_t *priv);
g3gg0's avatar
g3gg0 committed
24
25
uint32_t crypt_rsa_blocksize(crypt_priv_t *priv);
void crypt_rsa_generate_keys(crypt_priv_t *priv);
26
void crypt_rsa_set_keysize(uint32_t size);
g3gg0's avatar
g3gg0 committed
27
28
29
30
31
void crypt_rsa_clear_key(t_crypt_key *key);
uint32_t crypt_rsa_load(char *file, t_crypt_key *key);
void crypt_rsa_test();
void crypt_rsa_init(crypt_cipher_t *crypt_ctx);

32
33

#endif