From ae329773bceac769d845bea7196043e19b18a394 Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Mon, 8 Jan 2024 17:42:49 -0500 Subject: [PATCH] chore: improve BLS constant documentation (#5976) --- crates/rpc/rpc-types/src/beacon/constants.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/crates/rpc/rpc-types/src/beacon/constants.rs b/crates/rpc/rpc-types/src/beacon/constants.rs index 917a307247dc..945a4ba20450 100644 --- a/crates/rpc/rpc-types/src/beacon/constants.rs +++ b/crates/rpc/rpc-types/src/beacon/constants.rs @@ -1,4 +1,17 @@ -pub const BLS_DST: &[u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_"; +/// The Domain Separation Tag for hash_to_point in Ethereum beacon chain BLS12-381 signatures. +/// +/// This is also the name of the ciphersuite that defines beacon chain BLS signatures. +/// +/// See: +/// +/// +pub const BLS_DST_SIG: &[u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_"; + +/// The number of bytes in a BLS12-381 public key. pub const BLS_PUBLIC_KEY_BYTES_LEN: usize = 48; + +/// The number of bytes in a BLS12-381 secret key. pub const BLS_SECRET_KEY_BYTES_LEN: usize = 32; + +/// The number of bytes in a BLS12-381 signature. pub const BLS_SIGNATURE_BYTES_LEN: usize = 96;