priv.c (530B)
1 #include <stdio.h> 2 #include <openssl/bn.h> 3 4 int 5 main(int argc, char *argv[]) 6 { 7 BN_CTX *ctx; 8 BIGNUM *p, *q, *e, *n, *d; 9 10 ctx = BN_CTX_new(); 11 p = BN_new(); 12 q = BN_new(); 13 e = BN_new(); 14 n = BN_new(); 15 d = BN_new(); 16 17 BN_hex2bn(&p, "953AAB9B3F23ED593FBDC690CA10E703"); 18 BN_hex2bn(&q, "C34EFC7C4C2369164E953553CDF94945"); 19 BN_hex2bn(&e, "0D88C3"); 20 BN_mul(n, p, q, ctx); 21 22 /* Calculate private key */ 23 24 OPENSSL_free(p); 25 OPENSSL_free(q); 26 OPENSSL_free(e); 27 OPENSSL_free(n); 28 OPENSSL_free(q); 29 OPENSSL_free(ctx); 30 31 return (0); 32 }