/ console / program / src / data / ciphertext / mod.rs
mod.rs
 1  // Copyright (c) 2019-2025 Alpha-Delta Network Inc.
 2  // This file is part of the alphavm library.
 3  
 4  // Licensed under the Apache License, Version 2.0 (the "License");
 5  // you may not use this file except in compliance with the License.
 6  // You may obtain a copy of the License at:
 7  
 8  // http://www.apache.org/licenses/LICENSE-2.0
 9  
10  // Unless required by applicable law or agreed to in writing, software
11  // distributed under the License is distributed on an "AS IS" BASIS,
12  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  // See the License for the specific language governing permissions and
14  // limitations under the License.
15  
16  mod bytes;
17  mod decrypt;
18  mod equal;
19  mod from_bits;
20  mod from_fields;
21  mod num_randomizers;
22  mod parse;
23  mod serialize;
24  mod size_in_fields;
25  mod to_bits;
26  mod to_fields;
27  
28  use crate::Plaintext;
29  use alphavm_console_account::ViewKey;
30  use alphavm_console_network::prelude::*;
31  use alphavm_console_types::{Boolean, Field, Group};
32  
33  use core::ops::Deref;
34  
35  #[derive(Clone)]
36  pub struct Ciphertext<N: Network>(Vec<Field<N>>);
37  
38  impl<N: Network> Deref for Ciphertext<N> {
39      type Target = [Field<N>];
40  
41      fn deref(&self) -> &Self::Target {
42          &self.0
43      }
44  }