]> Git Repo - secp256k1.git/commit
Merge #699: Initialize field elements when resulting in infinity
authorTim Ruffing <[email protected]>
Wed, 9 Sep 2020 14:00:12 +0000 (16:00 +0200)
committerTim Ruffing <[email protected]>
Wed, 9 Sep 2020 14:04:08 +0000 (16:04 +0200)
commit875d68b95f58b61479c7deb200553bfb4b0af3d4
tree1c4c91cd285302856d8a4380f3801c905d1ef04e
parent54caf2e74f232e0e7984fa67d03e469fdda1437e
parent47a7b8382fd6f1458d859b315cf3bcd3b9790b68
Merge #699: Initialize field elements when resulting in infinity

47a7b8382fd6f1458d859b315cf3bcd3b9790b68 Clear field elements when writing infinity (Elichai Turkel)
61d1ecb02847be9d65ffe9df2d2408d85f3a0711 Added test with additions resulting in infinity (Elichai Turkel)

Pull request description:

  Currently if `secp256k1_gej_add_var` / `secp256k1_gej_add_ge_var` /` secp256k1_gej_add_zinv_var` receive `P + (-P)` it will set `gej->infinity = 1` but doesn't call initialize the field elements.
  Notice that this is the only branch in the function that results in an uninitialized output.

  By using `secp256k1_gej_set_infinity()` it will set the field elements to zero while also setting the infinity flag.

  I also added a test that fails with valgrind on current master but passes with the fix.

  EDIT: This isn't a bug or something necessary, I just personally found this helpful.

ACKs for top commit:
  real-or-random:
    ACK 47a7b8382fd6f1458d859b315cf3bcd3b9790b68

Tree-SHA512: cdc2efc242a1b04b4f081183c07d4b2602cdba705e6b30b548df4e115e54fb97691f4b1a28f142f02d5e523c020721337a297b17d732acde147b910f5c53bd0a
src/group_impl.h
src/tests.c
This page took 0.021696 seconds and 4 git commands to generate.