Skip to content

Signature not always the same#399

Open
nmalzieu wants to merge 1 commit intomainfrom
noe/signature-debugging
Open

Signature not always the same#399
nmalzieu wants to merge 1 commit intomainfrom
noe/signature-debugging

Conversation

@nmalzieu
Copy link
Contributor

Depending on the string that we sign, signing twice yields the same result (expected), or not (bug)

@nmalzieu nmalzieu requested a review from a team as a code owner September 11, 2024 13:49
let signature1_2 = try await privateKey.sign(stringToSign1.data(using: .utf8)!)
let uint1_2 = try [UInt8](signature1_2.serializedData())

XCTAssertEqual(uint1_1, uint1_2)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one passes

let signature2_2 = try await privateKey.sign(stringToSign2.data(using: .utf8)!)
let uint2_2 = try [UInt8](signature2_2.serializedData())

XCTAssertEqual(uint2_1, uint2_2)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one fails

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems strange. Will add it to the backlog for investigation.


XCTAssertEqual(uint1_1, uint1_2)

let stringToSign2 = "short"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at first I thought it was because the string was short but I managed to make it fail with longer strings also… maybe a byte length thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants