Update secp256k1signature.ts (#1670)

This commit is contained in:
Maxim Evtush 2025-06-16 15:35:45 +03:00 committed by GitHub
parent 6a8b686e5f
commit 46d760ec3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,7 +125,7 @@ export class Secp256k1Signature {
public toDer(): Uint8Array {
// DER supports negative integers but our data is unsigned. Thus we need to prepend
// a leading 0 byte when the higest bit is set to differentiate nagative values
// a leading 0 byte when the highest bit is set to differentiate negative values
const rEncoded = this.data.r[0] >= 0x80 ? new Uint8Array([0, ...this.data.r]) : this.data.r;
const sEncoded = this.data.s[0] >= 0x80 ? new Uint8Array([0, ...this.data.s]) : this.data.s;