Skip to content

Commit 8b9697e

Browse files
authored
Merge pull request #2375 from CosmWasm/aw/bls12_381-docs
Extend BLS12-381 documentation a bit
2 parents 1cd820c + 078b853 commit 8b9697e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/std/src/traits.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ pub trait Api {
184184
recovery_param: u8,
185185
) -> Result<Vec<u8>, RecoverPubkeyError>;
186186

187+
/// Add up points of the G1 subgroup on the BLS12-381 curve
188+
///
189+
/// The length of `g1s` must be a multiple of 48 (each point is encoded in 48 bytes).
187190
#[allow(unused_variables)]
188191
fn bls12_381_aggregate_g1(&self, g1s: &[u8]) -> Result<[u8; 48], VerificationError> {
189192
// Support for BLS12-381 is added in 2.1, i.e. we can't add a compile time requirement for new function.
@@ -193,6 +196,9 @@ pub trait Api {
193196
unimplemented!()
194197
}
195198

199+
/// Add up points of the G2 subgroup on the BLS12-381 curve
200+
///
201+
/// The length of `g2s` must be a multiple of 96 (each point is encoded in 96 bytes)
196202
#[allow(unused_variables)]
197203
fn bls12_381_aggregate_g2(&self, g2s: &[u8]) -> Result<[u8; 96], VerificationError> {
198204
// Support for BLS12-381 is added in 2.1, i.e. we can't add a compile time requirement for new function.
@@ -243,6 +249,9 @@ pub trait Api {
243249
unimplemented!()
244250
}
245251

252+
/// Take some arbitrary data and hash it to a point on the G1 subgroup of the curve.
253+
///
254+
/// The `dst` parameter should be a constant is actually something similar to the "context" parameter in key derivation functions.
246255
#[allow(unused_variables)]
247256
fn bls12_381_hash_to_g1(
248257
&self,
@@ -257,6 +266,9 @@ pub trait Api {
257266
unimplemented!()
258267
}
259268

269+
/// Take some arbitrary data and hash it to a point on the G2 subgroup of the curve.
270+
///
271+
/// The `dst` parameter should be a constant is actually something similar to the "context" parameter in key derivation functions.
260272
#[allow(unused_variables)]
261273
fn bls12_381_hash_to_g2(
262274
&self,

0 commit comments

Comments
 (0)