{"action":"created","issue":{"url":"https://api.github.com/repos/indutny/elliptic/issues/54","labels_url":"https://api.github.com/repos/indutny/elliptic/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/indutny/elliptic/issues/54/comments","events_url":"https://api.github.com/repos/indutny/elliptic/issues/54/events","html_url":"https://github.com/indutny/elliptic/issues/54","id":107227570,"number":54,"title":"Signing method returns the same signature every time (for a given key and message)","user":{"login":"shea256","id":994646,"avatar_url":"https://avatars.githubusercontent.com/u/994646?v=3","gravatar_id":"","url":"https://api.github.com/users/shea256","html_url":"https://github.com/shea256","followers_url":"https://api.github.com/users/shea256/followers","following_url":"https://api.github.com/users/shea256/following{/other_user}","gists_url":"https://api.github.com/users/shea256/gists{/gist_id}","starred_url":"https://api.github.com/users/shea256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shea256/subscriptions","organizations_url":"https://api.github.com/users/shea256/orgs","repos_url":"https://api.github.com/users/shea256/repos","events_url":"https://api.github.com/users/shea256/events{/privacy}","received_events_url":"https://api.github.com/users/shea256/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-18T15:48:35Z","updated_at":"2015-09-18T19:27:40Z","closed_at":"2015-09-18T18:46:04Z","body":"Here's the code I'm using:\r\n\r\n```js\r\nvar EC = require('elliptic').ec,\r\n    secp256k1 = new EC('secp256k1'),\r\n    sigFormatter = require('ecdsa-sig-formatter')\r\n\r\nvar privateKeyHex = 'a5c61c6ca7b3e7e55edee68566aeab22e4da26baa285c7bd10e8d2218aa3b229',\r\n    publicKeyHex = '027d28f9951ce46538951e3697c62588a87f1f1f295de4a14fdd4c780fc52cfe69',\r\n    privateKeyObject = secp256k1.keyFromPrivate(privateKeyHex, 'hex'),\r\n    publicKeyObject = secp256k1.keyFromPublic(publicKeyHex, 'hex')\r\n\r\nvar messageString = 'Hello, World',\r\n    messageBuffer = new Buffer(messageString),\r\n    messageBytes = messageBuffer.toJSON().data\r\n\r\nvar derSignatureObject = privateKeyObject.sign(messageBytes),\r\n    derSignatureArray = derSignatureObject.toDER(),\r\n    derSignatureBuffer = new Buffer(derSignatureArray),\r\n    joseSignature = sigFormatter.derToJose(derSignatureBuffer, 'ES256')\r\n\r\nconsole.log(derSignatureObject)\r\n\r\nvar verified = publicKeyObject.verify(messageBytes, derSignatureBuffer)\r\n\r\nconsole.log(verified)\r\n```\r\n\r\nIs there some issue with the method or am I doing something wrong?\r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/indutny/elliptic/issues/comments/141544770","html_url":"https://github.com/indutny/elliptic/issues/54#issuecomment-141544770","issue_url":"https://api.github.com/repos/indutny/elliptic/issues/54","id":141544770,"user":{"login":"shea256","id":994646,"avatar_url":"https://avatars.githubusercontent.com/u/994646?v=3","gravatar_id":"","url":"https://api.github.com/users/shea256","html_url":"https://github.com/shea256","followers_url":"https://api.github.com/users/shea256/followers","following_url":"https://api.github.com/users/shea256/following{/other_user}","gists_url":"https://api.github.com/users/shea256/gists{/gist_id}","starred_url":"https://api.github.com/users/shea256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shea256/subscriptions","organizations_url":"https://api.github.com/users/shea256/orgs","repos_url":"https://api.github.com/users/shea256/repos","events_url":"https://api.github.com/users/shea256/events{/privacy}","received_events_url":"https://api.github.com/users/shea256/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T19:27:40Z","updated_at":"2015-09-18T19:27:40Z","body":"OK thank you!"}}