On Wed, Oct 19, 2016 at 1:48 AM, Daniel Morris <dan...@honestempire.com> wrote:
> On Tue, 18 Oct 2016, at 09:22 AM, Nikita Popov wrote: > > On Tue, Oct 18, 2016 at 3:35 AM, Sara Golemon <poll...@php.net> wrote: > > > > > As it says on the tin: Wrap the BN (BigNumber) library in OpenSSL. > > Why do we need GMP when we have BCMath? Because GMP implements big integer arithmetic, while BCMath implements big decimal arithmetic. > GMP is faster (from what I've > seen so far from various tests and blog posts) – whilst they do similar > ops, they are chosen for specific reasons, all this does is expose the > existing interfaces for arbitrary precision arithmetic made available > with the OpenSSL layer, and I think anyone implementing them would want > the API there, it requires minimal maintenance. Sara, I think the best > route is too match the method names within OpenSSL, it will avoid some > initial confusion, unless people want to change libraries, but I think > that is probably less likely. > What are the specific reasons for choosing OpenSSL Bignums over GMP, outside of extension availability (which is totally a path I don't want us to go down -- see also recent attempts to duplicate ext/mbstring into ext/standard)? Are there any particular properties of the openssl implementation that are beneficial for certain applications? Nikita