Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. The format
## Table of Contents

- [Unreleased](#unreleased)
- [1.9.26 - 2025-12-10](#1926---2025-12-10)
- [1.9.25 - 2025-12-09](#1925---2025-12-09)
- [1.9.24 - 2025-12-09](#1924---2025-12-09)
- [1.9.23 - 2025-12-08](#1923---2025-12-08)
Expand Down Expand Up @@ -198,6 +199,17 @@ All notable changes to this project will be documented in this file. The format

---

## [1.9.26] - 2025-12-10

### Security
- Addressed TOB-25 by adding explicit ECDSA and elliptic-curve regression tests
ensuring correct propagation and handling of the point at infinity during
scalar multiplication and signature verification.
These tests prevent regressions where invalid infinity points could be
incorrectly treated as valid curve points.

---

## [1.9.25] - 2025-12-09

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bsv/sdk",
"version": "1.9.25",
"version": "1.9.26",
"type": "module",
"description": "BSV Blockchain Software Development Kit",
"main": "dist/cjs/mod.js",
Expand Down
27 changes: 27 additions & 0 deletions src/primitives/__tests/ECDSA.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as ECDSA from '../../primitives/ECDSA'
import BigNumber from '../../primitives/BigNumber'
import Curve from '../../primitives/Curve'
import Signature from '../../primitives/Signature'
import Point from '../../primitives/Point'

const msg = new BigNumber('deadbeef', 16)
const key = new BigNumber(
Expand Down Expand Up @@ -90,4 +91,30 @@ describe('ECDSA', () => {
ECDSA.sign(msg, key, undefined, n)
).toThrow()
})

it('k·G + (−k·G) results in point at infinity (TOB-25)', () => {
const k = new BigNumber('123456789abcdef', 16)

const P = curve.g.mul(k)
const negP = P.neg()
const sum = P.add(negP)

expect(sum.isInfinity()).toBe(true)
})

it('scalar multiplication by zero returns point at infinity (TOB-25)', () => {
const zero = new BigNumber(0)
const result = curve.g.mul(zero)

expect(result.isInfinity()).toBe(true)
})

it('ECDSA verify rejects point-at-infinity public key (TOB-25)', () => {
const signature = ECDSA.sign(msg, key)
const infinityPub = new Point(null, null)

expect(() =>
ECDSA.verify(msg, signature, infinityPub)
).toThrow()
})
})