-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gh-457] resolve repo and add schnorr.move
- Loading branch information
Feliciss
committed
Jul 19, 2023
1 parent
b9729e3
commit 9921453
Showing
5 changed files
with
76 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
<a name="0x3_schnorr"></a> | ||
|
||
# Module `0x3::schnorr` | ||
|
||
|
||
|
||
- [Function `verify`](#0x3_schnorr_verify) | ||
|
||
|
||
<pre><code></code></pre> | ||
|
||
|
||
|
||
<a name="0x3_schnorr_verify"></a> | ||
|
||
## Function `verify` | ||
|
||
@param signature: A 65-bytes signature that is signed using Schnorr over Secpk256k1 key pairs. | ||
@param msg: The message that the signature is signed against. | ||
@param hash: The hash function used to hash the message when signing. | ||
|
||
If the signature is valid to the pubkey and hashed message, return true. Else false. | ||
|
||
|
||
<pre><code><b>public</b> <b>fun</b> <a href="schnorr.md#0x3_schnorr_verify">verify</a>(signature: &<a href="">vector</a><u8>, msg: &<a href="">vector</a><u8>, <a href="../doc/hash.md#0x1_hash">hash</a>: u8): bool | ||
</code></pre> | ||
|
||
|
||
|
||
<details> | ||
<summary>Implementation</summary> | ||
|
||
|
||
<pre><code><b>public</b> <b>native</b> <b>fun</b> <a href="schnorr.md#0x3_schnorr_verify">verify</a>( | ||
signature: &<a href="">vector</a><u8>, | ||
msg: &<a href="">vector</a><u8>, | ||
<a href="../doc/hash.md#0x1_hash">hash</a>: u8 | ||
): bool; | ||
</code></pre> | ||
|
||
|
||
|
||
</details> |
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,30 @@ | ||
module rooch_framework::schnorr { | ||
/// @param signature: A 65-bytes signature that is signed using Schnorr over Secpk256k1 key pairs. | ||
/// @param msg: The message that the signature is signed against. | ||
/// @param hash: The hash function used to hash the message when signing. | ||
/// | ||
/// If the signature is valid to the pubkey and hashed message, return true. Else false. | ||
public native fun verify( | ||
signature: &vector<u8>, | ||
msg: &vector<u8>, | ||
hash: u8 | ||
): bool; | ||
|
||
// TODO add tests following ecdsa_k1 | ||
|
||
#[test] | ||
public fun test_schnorr_valid_sig() { | ||
} | ||
|
||
#[test] | ||
public fun test_schnorr_invalid_sig() { | ||
} | ||
|
||
#[test] | ||
public fun test_schnorr_valid_message() { | ||
} | ||
|
||
#[test] | ||
public fun test_schnorr_invalid_message() { | ||
} | ||
} |
Binary file not shown.