)]}'
{
  "commit": "3529cba4a554fde0ece75a07178c0dd63f73e409",
  "tree": "2234e245053cc3e7205da6fcb76a06d33e5c4fe2",
  "parents": [
    "24bd38f452eb34669d607da4f17e8ca6fc44b30e"
  ],
  "author": {
    "name": "David Benjamin",
    "email": "davidben@google.com",
    "time": "Fri Aug 09 16:59:53 2024 -0400"
  },
  "committer": {
    "name": "Boringssl LUCI CQ",
    "email": "boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Wed Aug 14 16:15:39 2024 +0000"
  },
  "message": "Cite where BN_div actually comes from\n\nAfter spending a while trying to divine where all the bounds came from,\nand coming up with some of the messy proofs for why it works, I found\nthis exact algorithm in Knuth, Volume 2, with... different messy proofs.\nSadly, this algorithm seems to just be messy. Cite it as reference\nrather than trying to repeat it in code.\n\nAs part of this, update the discussion on branches. That was added in\nhttps://boringssl-review.googlesource.com/c/boringssl/+/9105, back when\nBN_div was used on secret inputs. It no longer is and, back then, the\nfunction still wasn\u0027t constant-time anyway.\n\nWe could, in principle, restore the special cases now. But this would be\nmore complicated and diverge from Knuth\u0027s formulation, so let\u0027s just\nkeep it simple. (Although it might actually be a hair faster. We care\nabout this function to compute R^2 mod n, and the special case would\nsave an extra iteration through the loop. Though I think that\noptimization could actually be restored with much, much less code than\nOpenSSL originally did it. Probably not worth the fuss.)\n\nSubsequent CLs will clean this code up in reference to Knuth\u0027s\nformulation.\n\nBug: 358687140\nChange-Id: I56da99c560b845f1736ab86edc79b8e711890fe3\nReviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/70170\nReviewed-by: Bob Beck \u003cbbe@google.com\u003e\nCommit-Queue: David Benjamin \u003cdavidben@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "23e1b634f658dfd28e32a1af63ac87267c547151",
      "old_mode": 33188,
      "old_path": "crypto/fipsmodule/bn/div.c",
      "new_id": "0410fb7969494a620c1a2c974f1d112c7cb7433b",
      "new_mode": 33188,
      "new_path": "crypto/fipsmodule/bn/div.c"
    }
  ]
}
