Skip to content

Commit 177c9c3

Browse files
committed
Add generator tests
1 parent 68bea24 commit 177c9c3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/crypto/src/bls12_318/points.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,21 @@ pub fn bls12_381_g2_is_identity(g2: &[u8; BLS12_381_G2_POINT_LEN]) -> Result<boo
195195

196196
#[cfg(test)]
197197
mod tests {
198+
use crate::{BLS12_381_G1_GENERATOR_COMPRESSED, BLS12_381_G2_GENERATOR_COMPRESSED};
199+
198200
use super::*;
199201
use hex_literal::hex;
200202

201203
#[test]
202204
fn g1_generator_works() {
203-
let _gen = G1::generator();
205+
let generator = G1::generator();
206+
assert_eq!(generator.to_compressed(), BLS12_381_G1_GENERATOR_COMPRESSED);
204207
}
205208

206209
#[test]
207210
fn g2_generator_works() {
208-
let _gen = G2::generator();
211+
let generator = G2::generator();
212+
assert_eq!(generator.to_compressed(), BLS12_381_G2_GENERATOR_COMPRESSED);
209213
}
210214

211215
#[test]

0 commit comments

Comments
 (0)