diff options
| author | Benedict <benedict@0xb8000.de> | 2016-11-29 22:24:26 +0100 |
|---|---|---|
| committer | Benedict <benedict@0xb8000.de> | 2017-02-21 13:00:26 +0100 |
| commit | 544153a8ffa6d68385712ab0a7c6315399346909 (patch) | |
| tree | 9bdb43a05c388ba1fa1410b4757b9c00a3683f0d /lib/lib5.h | |
| parent | 30211642cbdee771ad4e0d8515719985e5c0c36a (diff) | |
completed challenge 40, set 5
Diffstat (limited to 'lib/lib5.h')
| -rw-r--r-- | lib/lib5.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -4,7 +4,9 @@ #include <stdlib.h> #include <stdint.h> #include <gmp.h> +#include <math.h> #include <openssl/bn.h> +#include<openssl/bio.h> struct dh_param { mpz_t A; @@ -19,6 +21,7 @@ struct dh_param { // global openssl context for auxaliry results BN_CTX *ctx; +BIO *out; struct extended_euclid { int d; @@ -61,8 +64,18 @@ int rsa_decrpyt(int message, struct rsa_key *private); int rsa_encrypt(int message, struct rsa_key *public); int modulo(int a, int b); void extended_euclid_algo(int a, int b, struct extended_euclid *e); +void extended_euclid_algo_bignum(BIGNUM *a, BIGNUM *b, struct extended_euclid_bignum *e); int rsa_generate_key_bignum(struct rsa_key_bignum *public, struct rsa_key_bignum *private); int free_rsa_key_bignum(struct rsa_key_bignum *t); int modular_multiplicative_inverse_bignum_my(BIGNUM *res, BIGNUM *number, BIGNUM *modulo); int modular_multiplicative_inverse(int number, int _modulo); +int rsa_broadcast_cube(BIGNUM *res, BIGNUM **a, BIGNUM **n); +int chinese_remainder_theorem_bignum(BIGNUM *solution, BIGNUM *sol_no_mod, BIGNUM **a, BIGNUM **n, int len); +int check_co_prime_bignum(BIGNUM *a, BIGNUM *b); +int check_co_prime_bignum(BIGNUM *a, BIGNUM *b); +int __chinese_remainder_theorem_bignum(BIGNUM *solution, BIGNUM *sol_no_mod, BIGNUM **a, BIGNUM **n, int len); +int check_co_prime(int a, int b); +int __chinese_remainder_theorem(int *a, int *n, int len); +int nth_root_bignum(BIGNUM *res, BIGNUM *number, BIGNUM *n); +double nth_root_wr(double x, int n); #endif |
