ec_pubkey_tweak_add issues #524

issue essemfly openend this issue on April 6, 2018
  1. essemfly commented at 1:26 am on April 6, 2018: none

    Hello, I have some problem on using this library and i have a question.

    In bitcoin mastering book, the associative rule is valid in pubkey operations but,

    in ec_pubkey_tweak_add, it does not work. i.e. (A+B) + C == A+(B+C) is not working.

    iex(7)> {ok, temp1} = :libsecp256k1.ec_pubkey_tweak_add(pub1_uncomp, pub2_uncomp) {:ok, «4, 109, 141, 100, 253, 107, 174, 35, 245, 166, 25, 186, 86, 155, 12, 144, 70, 106, 243, 169, 170, 114, 252, 176, 64, 146, 196, 235, 151, 71, 38, 236, 89, 202, 48, 110, 12, 105, 52, 67, 172, 206, 254, 158, 160, 121, 21, 235, …»} iex(8)> :libsecp256k1.ec_pubkey_tweak_add(temp1, pub3_uncomp) {:ok, «4, 95, 248, 51, 254, 221, 15, 68, 158, 218, 69, 248, 6, 55, 248, 212, 109, 182, 111, 157, 13, 147, 81, 103, 204, 128, 25, 64, 116, 221, 237, 165, 169, 140, 69, 89, 168, 148, 91, 40, 177, 5, 75, 39, 42, 43, 156, 221, …»} iex(9)> {ok, temp2} = :libsecp256k1.ec_pubkey_tweak_add(pub2_uncomp, pub3_uncomp) {:ok, «4, 32, 169, 149, 118, 49, 84, 197, 188, 184, 93, 47, 104, 172, 144, 152, 34, 208, 248, 213, 205, 28, 66, 197, 143, 151, 118, 145, 238, 27, 54, 145, 22, 160, 24, 76, 90, 68, 250, 244, 62, 47, 12, 222, 83, 6, 131, 101, …»} iex(10)> :libsecp256k1.ec_pubkey_tweak_add(pub1_uncomp, temp2) {:ok, «4, 47, 197, 182, 169, 48, 79, 165, 130, 115, 136, 120, 209, 222, 30, 114, 144, 203, 125, 120, 238, 77, 9, 140, 240, 207, 87, 20, 79, 19, 161, 129, 121, 166, 55, 192, 108, 235, 189, 132, 247, 177, 196, 236, 8, 196, 29, 31, …»}

    the result of iex(8) and iex(10) is not the same.

    what does the ec_pubkey_tweak_add do?

  2. sipa commented at 1:34 am on April 6, 2018: contributor

    It adds a specified multiple of G to a point. It does not add points together. Pleae check the types of what you’re passing.

    Also, what codebase is that? This repository is in C, and only has Java bindings.

  3. sipa closed this on Apr 6, 2018

  4. dcousens commented at 1:44 am on April 6, 2018: contributor
    @essemfly you are probably wanting secp256k1_ec_pubkey_combine
  5. dcousens commented at 1:46 am on April 6, 2018: contributor
    @sipa elixir looks similar
  6. essemfly commented at 1:48 am on April 6, 2018: none
    @sipa Elixir and i use erlang library https://github.com/mbrix/libsecp256k1. Thanks for reply. @dcousens Yes.. I wanted that function.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-22 08:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me