-
Notifications
You must be signed in to change notification settings - Fork 35
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: Switch to ffi_interface
#139
Merged
matkt
merged 8 commits into
hyperledger:main
from
kevaundray:kw/update-to-ffi-interface
Jan 29, 2024
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c0881f4
Modify test vectors to use valid scalars
kevaundray 6ad1236
fix verkle commit
kevaundray 2483f1c
modify pedersenHash result
kevaundray 2f364d4
update bindings to use ffi_interface
kevaundray 04c06aa
use rust 1.75.0
kevaundray c950cc7
reverse the endian for the tree_index
kevaundray de47628
Merge branch 'main' into kw/update-to-ffi-interface
kevaundray 1262393
Merge commit 'abd453aa7c27aa95c813eaacadad6b88000975f9' into kw/updat…
matkt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,9 @@ public void testCallLibrary() { | |
|
||
@Test | ||
public void testCallLibraryCommitRoot() { | ||
Bytes32 input = Bytes32.fromHexString("0xf6e31f7a565a390b48fdd24569ac10d43562d19de37ea951c7f9f250a339d059"); | ||
Bytes32 input = Bytes32.fromHexString("0x00e31f7a565a390b48fdd24569ac10d43562d19de37ea951c7f9f250a339d059"); | ||
Bytes32 result = Bytes32.wrap(LibIpaMultipoint.commitRoot(input.toArray())); | ||
Bytes32 expected = Bytes32.fromHexString("0x588f93e52b41d8d3abade94bf44a2ccd5d6ef9090a63164fba8d02c909168c53"); | ||
Bytes32 expected = Bytes32.fromHexString("0x3337896554fd3960bef9a4d0ff658ee8ee470cf9ca88a3c807cbe128536c5c05"); | ||
assertThat(result).isEqualTo(expected); | ||
} | ||
|
||
|
@@ -55,24 +55,24 @@ public void testCallLibraryWithManyElements() { | |
|
||
@Test | ||
public void testCallLibraryWithMaxElements() { | ||
Bytes32 element = Bytes32.fromHexString("0xd36f20567f74f607d9252186ff8efed04de4578d1ddb3de4fe6c5e4249e0045b"); | ||
Bytes32 element = Bytes32.fromHexString("0x006f20567f74f607d9252186ff8efed04de4578d1ddb3de4fe6c5e4249e0045b"); | ||
Bytes32[] arr = new Bytes32[256]; | ||
for (int i = 0; i < 256; i++) { | ||
arr[i] = element; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes are from #142 |
||
Bytes input = Bytes.concatenate(arr); | ||
Bytes32 result = Bytes32.wrap(LibIpaMultipoint.commit(input.toArray())); | ||
Bytes32 expected = Bytes32.fromHexString("0x069e4460d5dd6b48cfcb0a3338a84bc6e38fe686c9d9035017570c3fa10471d6"); | ||
Bytes32 expected = Bytes32.fromHexString("0x148badc53042581c95e71f21b2b85826bc2f4088e617cd18f488ab664af1d043"); | ||
assertThat(result).isEqualTo(expected); | ||
} | ||
|
||
@Test | ||
public void testCallLibraryPedersenHash() { | ||
// Example of passing address and trieIndex to pedersenHash. | ||
Bytes32 address = Bytes32.fromHexString("0xed3f9549040250ec5cdef31947e5213edee80ad2d5bba35c9e48246c5d9213d6"); | ||
Bytes32 trieIndex = Bytes32.fromHexString("0x1C4C6CE0115457AC1AB82968749EB86ED2D984743D609647AE88299989F91271"); | ||
Bytes32 address = Bytes32.fromHexString("0x003f9549040250ec5cdef31947e5213edee80ad2d5bba35c9e48246c5d9213d6"); | ||
Bytes32 trieIndex = Bytes32.fromHexString("0x004C6CE0115457AC1AB82968749EB86ED2D984743D609647AE88299989F91271"); | ||
byte[] total = Bytes.wrap(address, trieIndex).toArray(); | ||
Bytes result = Bytes.of(LibIpaMultipoint.pedersenHash(total)); | ||
assertThat(result).isEqualTo(Bytes32.fromHexString("0x2e50716b7d8c6d13d6005ea248f63f5a11ed63318cad38010f4bcb9a9c2e8b43")); | ||
assertThat(result).isEqualTo(Bytes32.fromHexString("0xff6e8f1877fd27f91772a4cec41d99d2f835d7320e929b8d509c5fa7ce095c51")); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was added because CI uses stable and matt was getting an unstable error from one of the newer libraries for a feature which should be stable as of 1.75. (1.68 is quite old)