-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify to only support secp256k1 but with extended type security
- Loading branch information
1 parent
f7d6034
commit 6b36e08
Showing
57 changed files
with
2,412 additions
and
4,295 deletions.
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
**`crysol` is a _simple_ and _secure_ secp256k1 crypto library for EVM applications** | ||
|
||
## Types | ||
|
||
High-Level: | ||
SecretKey uint \in [1, Q) | ||
PublicKey Point | ||
|
||
Arithmetic: | ||
Field: | ||
Felt uint \in [0, P) | ||
|
||
Point: | ||
Point (Felt, Felt) | ||
ProjectivePoint (Felt, Felt, Felt) | ||
|
||
While types increase costs, it provides more security. | ||
|
||
If _not_ using .wrap(), _MUST NOT_ be able to construct invalid object. | ||
|
||
tryXXX functions' return value is undefined if !ok. | ||
unsafeXXX functions' behaviour undefined if !ok. | ||
|
||
NEVER construct types yourself: | ||
- DON't .wrap | ||
- DON't PublicKey(x, y), Point(x, y), etc | ||
|
||
Audit Greps: | ||
- grep -rn "unsafe" src/ | ||
- grep -rn "wrap" src/ | ||
- grep -rn "PublicKey(" src/ | ||
- grep -rn "Point(" src/ | ||
- grep -rn "ProjectivePoint(" src/ | ||
- grep -rn "Signature(" src/ TODO: ??? | ||
|
||
## Signatures | ||
|
||
ECDSA and Schnorr are supported | ||
|
||
|
||
TODO: general parsing functions: | ||
tryPublicKeyFromBlob(bytes); | ||
publicKeyFromBlob(bytes); | ||
tryPointFromBlob(bytes); | ||
pointFromBlob(bytes); |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.