Skip to content

bn: use BN_set_word() to convert Fixnum - #1151

Open
rhenium wants to merge 1 commit into
ruby:masterfrom
rhenium:ky/bn-bn-new-set-word
Open

rhenium wants to merge 1 commit into
ruby:masterfrom
rhenium:ky/bn-bn-new-set-word

Conversation

@rhenium

@rhenium rhenium commented Nov 16, 2026

Copy link
Copy Markdown
Member

A Fixnum value typically fits in a single limb of a BIGNUM. Use Use BN_set_word() to avoid the unnecessary conversion to and from the BN_bin2bn() format.

This also prepares for the Fixnum range extension planned for Ruby 4.2.

A proposal to add the FIX2INTPTR() macro to Ruby's public headers is at ruby/ruby#19916.

A Fixnum value typically fits in a single limb of a BIGNUM. Use
Use BN_set_word() to avoid the unnecessary conversion to and from the
BN_bin2bn() format.

This also prepares for the Fixnum range extension planned for Ruby 4.2.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant