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

Crypto api ed25519 #771

Merged
merged 47 commits into from
Feb 17, 2021
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
46ebf59
k256 signature verification tests
maurolacy Feb 3, 2021
4844da9
Update lock files
maurolacy Feb 4, 2021
b98047c
Add secp256k1_verify to Api
maurolacy Feb 5, 2021
81d87de
Optimize required features
maurolacy Feb 6, 2021
eddb092
Revert "Add secp256k1_verify to Api"
maurolacy Feb 6, 2021
c5e9443
Add verify_secp256k1 native
maurolacy Feb 7, 2021
ccd44ec
Add ed25519_verify impl / test
maurolacy Feb 5, 2021
44e5f3a
Use slices instead of arrays for compat
maurolacy Feb 5, 2021
f1b86e2
Qualify ed25519 usage / imports
maurolacy Feb 5, 2021
879962c
Update lock files
maurolacy Feb 5, 2021
ff72db4
Simplify signature deserialization
maurolacy Feb 7, 2021
8d41b3a
Don't hash ed25519 message
maurolacy Feb 7, 2021
d4442ae
Improve syntax / variable names
maurolacy Feb 7, 2021
ebb6c46
Add Cosmos ed25519 signature tests
maurolacy Feb 7, 2021
f9bfdfd
Add comments / improve test constants names
maurolacy Feb 7, 2021
8143929
Add extra Cosmos ed25519 signature verification tests
maurolacy Feb 7, 2021
9b20a45
Add ed25519_verify to Api trait
maurolacy Feb 8, 2021
b01e2ac
Add verify_ed25519 VM import
maurolacy Feb 8, 2021
0f85f5d
Rename verify imports params / errors for clarity
maurolacy Feb 8, 2021
f0434f8
Fix rebase errors
maurolacy Feb 8, 2021
9b7df09
Move ed25519_verify to crypto crate
maurolacy Feb 11, 2021
015e852
Fix rebase
maurolacy Feb 11, 2021
a7aac0b
Update lock files
maurolacy Feb 12, 2021
f601f65
ed25519_verify returns bool
maurolacy Feb 12, 2021
c7d38b5
Add ed25519 checks / limits
maurolacy Feb 12, 2021
a0365c9
Add ed25519 native api tests
maurolacy Feb 12, 2021
63299ac
Add verify_ed25519 native
maurolacy Feb 12, 2021
3ead8f8
Fix ed25519_verify signature
maurolacy Feb 12, 2021
1950ed6
Add ed25519_verify MockApi impl
maurolacy Feb 12, 2021
c0ce241
Add (mock) API ed25519 (basic) tests
maurolacy Feb 12, 2021
d2c90ab
Update crypto-verify lock file
maurolacy Feb 14, 2021
9169eab
Add ed25519_verify documentation
maurolacy Feb 16, 2021
4ff7a7b
Update crypto package README.md
maurolacy Feb 16, 2021
f1bffbd
Update README.md / CHANGELOG.md
maurolacy Feb 16, 2021
67cadd1
Adapt ed25519_verify to VerificationError
maurolacy Feb 17, 2021
0543093
Add ed25519_verify to Api trait
maurolacy Feb 8, 2021
fe424b2
Add ed25519 checks / limits
maurolacy Feb 12, 2021
bb560d8
Add (mock) API ed25519 (basic) tests
maurolacy Feb 12, 2021
81e1624
Add crypto-verify contract ed25519 support
maurolacy Feb 14, 2021
5bc28fc
Add ed25519 integration tests
maurolacy Feb 14, 2021
075be09
Update schema
maurolacy Feb 14, 2021
b0e3630
Remove duplicate tests (rebase errors)
maurolacy Feb 17, 2021
accf545
Adapt crypto-verify contract ed25519 support to VerificationError
maurolacy Feb 17, 2021
da0b7c3
Remove redundant import
maurolacy Feb 17, 2021
b47a968
Improve results handling, add comments
maurolacy Feb 17, 2021
88ea312
Increase max message size to 128KiB
maurolacy Feb 17, 2021
c834dbf
Refactor crypto.rs into secp256k1.rs and ed25519.rs
maurolacy Feb 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/vm/src/imports.rs
Original file line number Diff line number Diff line change
@@ -37,6 +37,15 @@ const MAX_LENGTH_CANONICAL_ADDRESS: usize = 32;
const MAX_LENGTH_HUMAN_ADDRESS: usize = 90;
const MAX_LENGTH_QUERY_CHAIN_REQUEST: usize = 64 * KI;

/// Length of a (sha-256) hash in bytes
const LENGTH_SHA256_HASH: usize = 32;

/// Max length of a serialized signature
const MAX_LENGTH_SIGNATURE: usize = 64;

/// Max length of a serialized public key
const MAX_LENGTH_PUBKEY: usize = 33;

/// Max length for a debug message
const MAX_LENGTH_DEBUG: usize = 2 * MI;