-
Notifications
You must be signed in to change notification settings - Fork 11
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
Initial Rust implementation #174
Merged
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
5b6bc86
[DRAFT]
ebfull 5906175
Merge remote-tracking branch 'upstream/master' into 'rust-interpreter'
sellout d2763f9
Rearrange Rust impl to match C++ more closely
sellout 3d71aef
Rename Rust identifiers to match C++
sellout 336d0fe
Connected the new API, but fails
sellout bd168e1
Existing unit tests succeed
sellout 571836d
The rest of the owl
sellout 1b57460
Reverting to C++ style, and some other changes
sellout 0329117
Appease Clippy
sellout ebca981
Replace `ScriptNum` panics with error case
sellout d9d46cd
Add some shallow property tests
sellout a16d6ad
Add shallow fuzz testing
sellout 4c34b3e
Preserve richer errors on the Rust side
sellout 81fdb8e
Address @nuttycom’s review comments
sellout e0fabfa
Merge remote-tracking branch 'upstream/master' into rust-interpreter
sellout db4be8b
Some changes to ease zebrad integration
sellout f215757
Appease Clippy
sellout a902385
Merge remote-tracking branch 'upstream/master' into rust-interpreter
sellout e93f574
Merge remote-tracking branch 'origin/master' into sellout/rust-interp…
conradoplg cf7662c
Remove dependency on zcash_primitives
sellout 7d1711a
Moving testing dependencies
sellout 243582c
Normalize Rust errors in comparison interpreter
sellout 5e6d8cf
Address @nuttycom’s PR feedback
sellout 6caeeb4
Eliminate a `panic!`
sellout 7a15212
Use (`Try`)`From` for `ScriptNum` conversions
sellout e58aae5
Merge remote-tracking branch 'upstream/master' into rust-interpreter
sellout 241bfea
Remove some `From` instances that do too much
sellout fb58a44
Subtract from `OP_RESERVED` instead of `OP_1 - 1`
sellout 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//! Modules that we use from Zcash, but that are outside the script directory. | ||
nuttycom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
pub mod pubkey; | ||
pub mod uint256; |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use super::uint256::*; | ||
|
||
/// FIXME: `PUBLIC_KEY_SIZE` is meant to be an upper bound, it seems. Maybe parameterize the type | ||
/// over the size. | ||
pub struct PubKey<'a>(pub &'a [u8]); | ||
|
||
impl PubKey<'_> { | ||
pub const PUBLIC_KEY_SIZE: usize = 65; | ||
pub const COMPRESSED_PUBLIC_KEY_SIZE: usize = 33; | ||
|
||
/// Check syntactic correctness. | ||
/// | ||
/// Note that this is consensus critical as CheckSig() calls it! | ||
pub fn is_valid(&self) -> bool { | ||
self.0.len() > 0 | ||
} | ||
|
||
/// Verify a DER signature (~72 bytes). | ||
/// If this public key is not fully valid, the return value will be false. | ||
pub fn verify(&self, hash: &UInt256, vch_sig: &[u8]) -> bool { | ||
todo!() | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// FIXME: This probably needs to be an actually separate type somewhere. | ||
pub type UInt256 = [u8; 32]; | ||
sellout marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
@sellout you should add yourself to "authors", as well as
"Electric Coin Company <[email protected]>"
.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.
A 🎉 means that I have verified that the comment has been addressed in #197 . Note that any other emoji does not mean that.