forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbls12381.move
22 lines (19 loc) · 1.19 KB
/
bls12381.move
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
module sui::bls12381 {
friend sui::validator;
/// @param signature: A 48-bytes signature that is a point on the G1 subgroup.
/// @param public_key: A 96-bytes public key that is a point on the G2 subgroup.
/// @param msg: The message that we test the signature against.
///
/// If the signature is a valid signature of the message and public key according to
/// BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_, return true. Otherwise, return false.
public native fun bls12381_min_sig_verify(signature: &vector<u8>, public_key: &vector<u8>, msg: &vector<u8>): bool;
/// @param signature: A 96-bytes signature that is a point on the G2 subgroup.
/// @param public_key: A 48-bytes public key that is a point on the G1 subgroup.
/// @param msg: The message that we test the signature against.
///
/// If the signature is a valid signature of the message and public key according to
/// BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_, return true. Otherwise, return false.
public native fun bls12381_min_pk_verify(signature: &vector<u8>, public_key: &vector<u8>, msg: &vector<u8>): bool;
}