created why2_chat_rsa_pri_decrypt

This commit is contained in:
Václav Šmejkal 2024-04-13 13:40:26 +02:00
parent 2a9df2a4b9
commit 9cf062565a
Signed by: ENGO150
GPG Key ID: 4A57E86482968843
2 changed files with 6 additions and 0 deletions

View File

@ -42,6 +42,7 @@ char *why2_get_chat_modulus(void); //GET THE RSA MODULUS
char *why2_get_chat_d(void); //GET THE RSA d char *why2_get_chat_d(void); //GET THE RSA d
char *why2_chat_rsa_pub_encrypt(long to_encrypt); //RSA ENCRYPT USING PUBLIC KEY char *why2_chat_rsa_pub_encrypt(long to_encrypt); //RSA ENCRYPT USING PUBLIC KEY
char *why2_chat_rsa_pri_decrypt(long to_decrypt); //RSA DECRYPT USING PRIVATE KEY
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -197,4 +197,9 @@ char *why2_get_chat_d(void)
char *why2_chat_rsa_pub_encrypt(long to_encrypt) char *why2_chat_rsa_pub_encrypt(long to_encrypt)
{ {
return exp_mod(to_encrypt, WHY2_CHAT_RSA_EXPONENT); return exp_mod(to_encrypt, WHY2_CHAT_RSA_EXPONENT);
}
char *why2_chat_rsa_pri_decrypt(long to_decrypt)
{
return exp_mod(to_decrypt, why2_get_chat_d());
} }