)]}'
{
  "commit": "d4396e387c820198f509a6927facea84592cddd8",
  "tree": "b9b74b21eee4ab6dca0c0e0978cb508a7cb33945",
  "parents": [
    "d1b451676eada2f2dcad9a20debf8b76fa17f403"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Wed Feb 01 15:35:56 2023 -0500"
  },
  "committer": {
    "name": "Boringssl LUCI CQ",
    "email": "boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Mon Feb 06 21:12:45 2023 +0000"
  },
  "message": "Avoid branches in GCC in bn/generic.c.\n\nbn/generic.c is used for functions like bn_add_words, when there is no\nassembly implementation available. They\u0027re meant to be constant-time,\nbut are particularly dependent on the compiler in this. I ran our\nvalgrind-based tooling and found a couple issues in GCC:\n\nFirst, the various mul_add and sqr_add macros end up branching in GCC.\nReplacing the conditionals with expressions like c +\u003d (a \u003c b) seems to\nmitigate this.\n\nSecond, bn_sub_words produces branches in GCC. Replacing the expressions\nwith bit expressions involving the boolean comparisons seems to work for\nnow. https://gcc.gnu.org/bugzilla/show_bug.cgi?id\u003d79173 discusses\nproblems with GCC here, which seem to be as yet unresolved.\n\nClang already reliably avoided branches in all of these. (Though it\nstill spills the carry flag far more than would be ideal.)\n\nI also checked in godbolt that the new versions didn\u0027t generate branches\nin MSVC, but we don\u0027t have tooling to validate this as rigorously.\n\nChange-Id: I739758a396fb5ee27fb88bee71bd13ae9cb92bd0\nReviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/56967\nCommit-Queue: David Benjamin \u003cdavidben@google.com\u003e\nReviewed-by: Bob Beck \u003cbbe@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "df4a834af721bfc69032cf9a207e53a3068d38b6",
      "old_mode": 33188,
      "old_path": "crypto/fipsmodule/bn/generic.c",
      "new_id": "bf4971f1604883cf252d06717e0fac1b091b1163",
      "new_mode": 33188,
      "new_path": "crypto/fipsmodule/bn/generic.c"
    }
  ]
}
