Re: logarithm in OpenSSL

2019-07-25 Thread Niklas Niere
The BN_num_bits() approximation is exactly what we need. We need it to 
compute the depth of a node in a binary tree of which we only have a sub 
tree available.


Thank you,
Niklas

On 24.07.2019 23:59, Dr Paul Dale wrote:

I’m wondering why you need the log function?
If you’re measuring performance, could the analysis tool perform the logarithm?

A first order approximation to log_2(n) where n is a BIGNUM would be 
BN_num_bits(n).


Pauli


Re: Openssl binary with statically linked libssl and libcrypto

2019-07-25 Thread Salz, Rich via openssl-users
>Sadly, I can not make use of the "no-shared" option as I still need the
shared libraries to be built.
  
Statically linking against files built for shared libraries is possible on many 
platforms (link against the .a even though .so exists), but not all platforms.

You can always build twice.



Re: Openssl binary with statically linked libssl and libcrypto

2019-07-25 Thread K Lengauer
I see. Thank you again for answering and for the example ./config arguments.

Sadly, I can not make use of the "no-shared" option as I still need the
shared libraries to be built.

But I wonder if there even is a way to achieve both at the same time.



--
Sent from: http://openssl.6102.n7.nabble.com/OpenSSL-User-f3.html


EVP_KEY_cmp and -_parameters issues

2019-07-25 Thread Johannes.Heinz
I have a question to following situation with RSA and DH structures:
I'm testing these in separated unit tests.
Both test cases (each one for RSA and DH) are doing the same:

I'm creating a new DH or RSA structure, filling it with my params (pqg ...) and 
convert it to an EVP_PKEY (for example: EVP_PKEY_assign_DH => pkey1)
Next step, I'm writing and reading this structure with these functions:
PEM_write_bio_PrivateKey() (not PEM_write_bio_PrivateKey_traditional() ) (with 
password)
EVP_PKEY* pkey2 = PEM_read_bio_PrivateKey() (with same password)
(or even without a password)

Now I want to compare these two EVP_PKEY* variables (pkey1 and pkey2) and for 
that I can use these two functions:
EVP_PKEY_cmp(pkey1, pkey2) (compares components and params)
EVP_PKEY_cmp_parameters(pkey1, pkey2) (compares params)

Now the Problem:
Even the tests work the same way, the one with RSA only accept the 
compare-function "EVP_PKEY_cmp" and not the other one.
The one with DH is only with the "EVP_PKEY_cmp_parameters" successful.

Question:
Why can the first compare function find the components and params of the RSA 
structure (and even after the PEM_write_bio...) and not of the DH?
Also, why it's with the second compare function (only params) the other way 
around (keys match in DH unit test and not in RSA unit test)?

Greetings
Johannes