Discussion:
integration of my own bigint multiplication
Christian Kirbach
2005-10-07 11:49:58 UTC
Permalink
hi folks,

as part of my Diploma Thesis I am about to integrate my own
implementation of the multiplication of two large integers.
I'd like to replace the bigint multiplication of OpenSSL's RSA
implementation.

I've had a first look at the documentation and sources and wonder if I
should create a new engine or modify OpenSSL's RSA implementation to
make use of my bigint multiplication.


Any hints and suggestions are *very* much appreciated. Thanks.
--
Christian Kirbach <***@student.uni-siegen.de>
PGP key 1FE120E3
Nils Larsch
2005-10-09 10:37:18 UTC
Permalink
Post by Christian Kirbach
hi folks,
as part of my Diploma Thesis I am about to integrate my own
implementation of the multiplication of two large integers.
I'd like to replace the bigint multiplication of OpenSSL's RSA
implementation.
I've had a first look at the documentation and sources and wonder if I
should create a new engine or modify OpenSSL's RSA implementation to
make use of my bigint multiplication.
Any hints and suggestions are *very* much appreciated. Thanks.
well you could of course modify the crypto/bn code, however this
requires some knowledge of the internals of the bignum library. If
you just want to use your code for signing etc. you should perhaps
try to write an engine (see engines/e_gmp.c for an example).

Cheers,
Nils

--
Nils Larsch ***@openssl.org
OpenSSL Project http://www.openssl.org/~nils/
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Christian Kirbach
2005-10-10 15:11:51 UTC
Permalink
Post by Nils Larsch
Post by Christian Kirbach
as part of my Diploma Thesis I am about to integrate my own
implementation of the multiplication of two large integers.
I'd like to replace the bigint multiplication of OpenSSL's RSA
implementation.
well you could of course modify the crypto/bn code, however this
requires some knowledge of the internals of the bignum library. If
you just want to use your code for signing etc. you should perhaps
try to write an engine (see engines/e_gmp.c for an example).
Thanks for responding.
Of course an engine would be a clean solution, but all I really want to
replace is the multiplication of two big integers.
I've decided to do a brief proof-of-concept hack.

If I analysed correctly I need to replace
bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, int nb)
in crypto/bn/bn_mul.c with my own implementation.
--
Christian Kirbach <***@student.uni-siegen.de>
PGP key 1FE120E3

______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Christian Kirbach
2005-10-11 18:05:44 UTC
Permalink
where is a good place to put an acc_init() function that needs to be
called once? and where to put the counterpart, a acc_finish() call?

I have added my .c modules to the crypto/bn folder and added them to the
Makefile.
After "./config" and "make" the .o object files get compiled correctly.
With "nm -s libcrypto.a" I can see that it seems to integrate my
routines properly if I interpret the output correctly.

However when it gets to linking in openssl-0.9.8/apps it says

../libcrypto.a(bn_mul.o)(.text+0x1550): In function `BN_mul':
: undefined reference to `acc_multiply'
collect2: ld returned 1 exit status

I thought my routine acc_multiply was in libcrypto.a !?

BN_mul() in bn_mul.c cally my routine.

Thanks.
--
Christian Kirbach <***@student.uni-siegen.de>
PGP key 1FE120E3

______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List openssl-***@openssl.org
Automated List Manager ***@openssl.org
Loading...