refactor(lee_core): expose ciphertext bytes and nullifier byte-array

This commit is contained in:
Artem Gureev 2026-07-07 15:58:54 +00:00 committed by agureev
parent 301273dd44
commit 7333c8d304
2 changed files with 10 additions and 5 deletions

View File

@ -97,11 +97,6 @@ impl NullifierPublicKey {
#[cfg(feature = "host")]
impl Nullifier {
#[must_use]
pub const fn to_byte_array(&self) -> [u8; 32] {
self.0
}
#[cfg(feature = "host")]
#[must_use]
pub const fn from_byte_array(bytes: [u8; 32]) -> Self {
@ -117,6 +112,11 @@ impl Nullifier {
}
impl Ciphertext {
#[must_use]
pub fn as_bytes(&self) -> &[u8] {
&self.0
}
/// Serializes the ciphertext to bytes.
#[must_use]
pub fn to_bytes(&self) -> Vec<u8> {

View File

@ -117,6 +117,11 @@ impl Nullifier {
bytes.extend_from_slice(nullifier_seed);
Self(Impl::hash_bytes(&bytes).as_bytes().try_into().unwrap())
}
#[must_use]
pub const fn to_byte_array(&self) -> [u8; 32] {
self.0
}
}
#[cfg(test)]