(point)
| 109 | } |
| 110 | |
| 111 | encodePointForHash(point) { |
| 112 | const result = Buffer.alloc(69); |
| 113 | result.writeUInt32BE(65, 0); |
| 114 | result[4] = 4; |
| 115 | Buffer.from(point.getX().toArray('be', 32)).copy(result, 5); |
| 116 | Buffer.from(point.getY().toArray('be', 32)).copy(result, 37); |
| 117 | return result; |
| 118 | } |
| 119 | |
| 120 | decodePoint(data) { |
| 121 | if (data[0] !== 65 || data[1] !== 4) throw new Error('Invalid point format'); |