-
Notifications
You must be signed in to change notification settings - Fork 0
feat(prover): Memory-mapped private input for guest programs #512
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
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
82ca002
fix executor bugs
ColoCarletti 4cd0262
add private inputs feature
ColoCarletti fe5ce4b
Merge branch 'main' into feat/private-input-v2
ColoCarletti 7adb2d9
merge
ColoCarletti 13a33ef
change page size
ColoCarletti 852caef
fmt
ColoCarletti 018ca30
fix_tests
ColoCarletti a74b854
Merge branch 'main' into feat/private-input-v2
ColoCarletti 4b85658
Merge branch 'main' into feat/private-input-v2
ColoCarletti 1c83f3c
Merge branch 'main' into feat/private-input-v2
ColoCarletti 7027205
fix
ColoCarletti f022518
Merge branch 'feat/private-input-v2' of github.com:yetanotherco/lambd…
ColoCarletti 1e9a4b4
Merge branch 'main' into feat/private-input-v2
ColoCarletti 0ab0911
fix_merge
ColoCarletti 96de63b
fmt
ColoCarletti d576cec
Merge branch 'main' into feat/private-input-v2
ColoCarletti dcf7929
fix_comments
ColoCarletti bd2b0fb
Merge branch 'feat/private-input-v2' of github.com:yetanotherco/lambd…
ColoCarletti d3326af
change verifier privete_inputs handle
ColoCarletti d610c84
fmt
ColoCarletti de9e0ec
Merge branch 'main' into feat/private-input-v2
diegokingston 3df476e
add max private input size
ColoCarletti 17b5b61
Merge branch 'feat/private-input-v2' of github.com:yetanotherco/lambd…
ColoCarletti 5501b94
fmt
ColoCarletti 37f6641
fmt
ColoCarletti a27148c
fmt
ColoCarletti b3cdaa5
test: add security tests for private input tamper scenarios
MauroToscano 2241eac
clippy + fmt
MauroToscano e065a7d
clippy + fmt
MauroToscano 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| .attribute 5, "rv64i2p1" | ||
| .globl main | ||
| main: | ||
| # Read private input directly from 0xFF000000 (memory-mapped). | ||
| # Layout: [len:u32 LE] [data...] | ||
| # Commits 8 bytes of data. | ||
| # | ||
| # Note: lui in RV64 sign-extends to 64 bits. lui with 0xFF000 would give | ||
| # 0xFFFFFFFFFF000000. To get 0xFF000000 we need to construct it differently: | ||
| # lui x, 0x100000 gives 0x100000000 (53 upper bits), too high. | ||
| # Instead: load 0x0FF00000 and shift left by 4 bits, OR similar tricks. | ||
| # Simplest: use li macro and let the assembler handle it. | ||
|
|
||
| li t0, 0xFF000000 # 1: t0 = 0xFF000000 (private input base) | ||
|
|
||
| # Read length at 0xFF000000 | ||
| lw t3, 0(t0) # 2: t3 = length | ||
|
|
||
| # Load 8 bytes of data at 0xFF000008 (aligned, 4 bytes into data region) | ||
| ld t1, 8(t0) # 3 | ||
|
|
||
| # Commit 8 bytes from 0xFF000008 | ||
| addi a1, t0, 8 # 4: buf_addr = 0xFF000008 | ||
| li a0, 1 # 5: fd = 1 | ||
| li a2, 8 # 6: count = 8 | ||
| li a7, 64 # 7: syscall = Commit | ||
| ecall # 8: commit | ||
|
|
||
| # Halt | ||
| li a0, 0 # 9: exit_code = 0 | ||
| li a7, 93 # 10: syscall = Halt | ||
| ecall # 11: halt |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| use lambda_vm_syscalls as syscalls; | ||
|
|
||
| pub fn main() { | ||
| let input: Vec<u8> = syscalls::syscalls::get_private_input().unwrap(); | ||
| let input: Vec<u8> = syscalls::syscalls::get_private_input(); | ||
| syscalls::syscalls::print_string(format!("Private input received: {:?}\n", input).as_str()); | ||
| syscalls::syscalls::commit(&input); | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
Binary file not shown.
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.