Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Java interop PR #70

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

chore: Java interop PR #70

wants to merge 5 commits into from

Conversation

kevaundray
Copy link
Contributor

@kevaundray kevaundray commented Jan 23, 2024

This will not be merged.

It serves to show that the java impl was not checking that the scalar was canonical and also to add interop tests

common/common_test.go Outdated Show resolved Hide resolved
Comment on lines +11 to +30
func TestJavaRegressionOneEndian(t *testing.T) {
hexStr := "f6e31f7a565a390b48fdd24569ac10d43562d19de37ea951c7f9f250a339d059"
byteArray := hexStrToBytes(hexStr)
_scalar, err := common.ReadScalar(bytes.NewReader(byteArray))

if err == nil {
t.Fatalf("expected an error because the scalar is too large")
}
_ = _scalar
}
func TestJavaRegressionOtherEndian(t *testing.T) {
hexStr := "f6e31f7a565a390b48fdd24569ac10d43562d19de37ea951c7f9f250a339d059"
byteArray := hexStrToBytes(hexStr)
reverse(byteArray)
_scalar, err := common.ReadScalar(bytes.NewReader(byteArray))
if err == nil {
t.Fatalf("expected an error because the scalar is too large, even though we changed the endian")
}
_ = _scalar
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are the failing tests

@kevaundray kevaundray changed the title chore: Add failing test chore: Java interop PR Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant