mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-07-09 15:29:34 +00:00
refactor(lee_core): expose ciphertext bytes and nullifier byte-array
This commit is contained in:
parent
301273dd44
commit
7333c8d304
@ -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> {
|
||||
|
||||
@ -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)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user