Skip to content

Commit

Permalink
6.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny committed Jun 1, 2016
1 parent 8db7448 commit 236f373
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
18 changes: 14 additions & 4 deletions dist/elliptic.js
Expand Up @@ -268,9 +268,19 @@ BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
bytes = utils.toArray(bytes, enc);

var len = this.p.byteLength();
if (bytes[0] === 0x04 && bytes.length - 1 === 2 * len) {
return this.point(bytes.slice(1, 1 + len),
bytes.slice(1 + len, 1 + 2 * len));

// uncompressed, hybrid-odd, hybrid-even
if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&
bytes.length - 1 === 2 * len) {
if (bytes[0] === 0x06)
assert(bytes[bytes.length - 1] % 2 === 0);
else if (bytes[0] === 0x07)
assert(bytes[bytes.length - 1] % 2 === 1);

var res = this.point(bytes.slice(1, 1 + len),
bytes.slice(1 + len, 1 + 2 * len));

return res;
} else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&
bytes.length - 1 === len) {
return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);
Expand Down Expand Up @@ -8552,7 +8562,7 @@ if (typeof Object.create === 'function') {
},{}],26:[function(require,module,exports){
module.exports={
"name": "elliptic",
"version": "6.2.7",
"version": "6.2.8",
"description": "EC cryptography",
"main": "lib/elliptic.js",
"files": [
Expand Down

0 comments on commit 236f373

Please sign in to comment.