{"action":"created","issue":{"url":"https://api.github.com/repos/libtom/libtommath/issues/31","labels_url":"https://api.github.com/repos/libtom/libtommath/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/libtom/libtommath/issues/31/comments","events_url":"https://api.github.com/repos/libtom/libtommath/issues/31/events","html_url":"https://github.com/libtom/libtommath/pull/31","id":52603806,"number":31,"title":"Jacobi symbol erronous and incomplete, repair and extend?","user":{"login":"czurnieden","id":5593270,"avatar_url":"https://avatars.githubusercontent.com/u/5593270?v=3","gravatar_id":"","url":"https://api.github.com/users/czurnieden","html_url":"https://github.com/czurnieden","followers_url":"https://api.github.com/users/czurnieden/followers","following_url":"https://api.github.com/users/czurnieden/following{/other_user}","gists_url":"https://api.github.com/users/czurnieden/gists{/gist_id}","starred_url":"https://api.github.com/users/czurnieden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czurnieden/subscriptions","organizations_url":"https://api.github.com/users/czurnieden/orgs","repos_url":"https://api.github.com/users/czurnieden/repos","events_url":"https://api.github.com/users/czurnieden/events{/privacy}","received_events_url":"https://api.github.com/users/czurnieden/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/libtom/libtommath/milestones/1","html_url":"https://github.com/libtom/libtommath/milestones/v0.43.0","labels_url":"https://api.github.com/repos/libtom/libtommath/milestones/1/labels","id":412814,"number":1,"title":"v0.43.0","description":"Next version","creator":{"login":"sjaeckel","id":294374,"avatar_url":"https://avatars.githubusercontent.com/u/294374?v=3","gravatar_id":"","url":"https://api.github.com/users/sjaeckel","html_url":"https://github.com/sjaeckel","followers_url":"https://api.github.com/users/sjaeckel/followers","following_url":"https://api.github.com/users/sjaeckel/following{/other_user}","gists_url":"https://api.github.com/users/sjaeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/sjaeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjaeckel/subscriptions","organizations_url":"https://api.github.com/users/sjaeckel/orgs","repos_url":"https://api.github.com/users/sjaeckel/repos","events_url":"https://api.github.com/users/sjaeckel/events{/privacy}","received_events_url":"https://api.github.com/users/sjaeckel/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":2,"state":"open","created_at":"2013-08-27T16:24:09Z","updated_at":"2015-11-25T14:35:49Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2014-12-21T19:32:37Z","updated_at":"2015-11-29T21:48:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/libtom/libtommath/pulls/31","html_url":"https://github.com/libtom/libtommath/pull/31","diff_url":"https://github.com/libtom/libtommath/pull/31.diff","patch_url":"https://github.com/libtom/libtommath/pull/31.patch"},"body":"The evaluation of the Jacobi symbol is incorrect at 0/1. It returns 0 instead of 1. ( definition of the null-product)\r\n\r\nIt is incomplete: the domain of  the numerator of the Jacobi symbol is the whole Z. Negative numerators can be computed with the help of quadratic reciprocity, that is: (n/m) = (-1/n)(n/m). The value of (-1/n) comes from the Legendre symbol (1) and is  (-1)^((n-1)/2). The lowest two bits of n are enough to compute this factor but working with the whole lowest limb might be more legible..\r\n\r\nProblem: some users might have built around the old behaviour, hence the question mark.\r\n\r\nI stumbled over it because I want to implement the [Baillie-PSW test](http://www.trnicely.net/misc/bpsw.html). One of the functions&mdash;the Lucas-Selfridge test&mdash;needs a full implementation of the Jacobi symbol.\r\n\r\n(1) from the congruence  a^((p-1)/2) = (a/p) mod p\r\nsee for example: Henri Cohen \"A Course in Computational Algebraic Number Theory\" of which you might find a copy on the internet."},"comment":{"url":"https://api.github.com/repos/libtom/libtommath/issues/comments/160474498","html_url":"https://github.com/libtom/libtommath/pull/31#issuecomment-160474498","issue_url":"https://api.github.com/repos/libtom/libtommath/issues/31","id":160474498,"user":{"login":"sjaeckel","id":294374,"avatar_url":"https://avatars.githubusercontent.com/u/294374?v=3","gravatar_id":"","url":"https://api.github.com/users/sjaeckel","html_url":"https://github.com/sjaeckel","followers_url":"https://api.github.com/users/sjaeckel/followers","following_url":"https://api.github.com/users/sjaeckel/following{/other_user}","gists_url":"https://api.github.com/users/sjaeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/sjaeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjaeckel/subscriptions","organizations_url":"https://api.github.com/users/sjaeckel/orgs","repos_url":"https://api.github.com/users/sjaeckel/repos","events_url":"https://api.github.com/users/sjaeckel/events{/privacy}","received_events_url":"https://api.github.com/users/sjaeckel/received_events","type":"User","site_admin":false},"created_at":"2015-11-29T21:48:44Z","updated_at":"2015-11-29T21:48:44Z","body":"grml damn github creating pull requests based on master\r\n@czurnieden can you please have a look at the last three commits..."}}