oasis_runtime_sdk/types/
callformat.rs

1//! Types related to call formats.
2use crate::core::common::crypto::{mrae::deoxysii, x25519};
3
4/// Call data key pair ID domain separation context base.
5pub const CALL_DATA_KEY_PAIR_ID_CONTEXT_BASE: &[u8] = b"oasis-runtime-sdk/private: tx";
6
7/// A call envelope when using the EncryptedX25519DeoxysII format.
8#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
9pub struct CallEnvelopeX25519DeoxysII {
10    /// Caller's ephemeral public key used for X25519.
11    pub pk: x25519::PublicKey,
12    /// Nonce.
13    pub nonce: [u8; deoxysii::NONCE_SIZE],
14    /// Epoch of the ephemeral runtime key.
15    #[cbor(optional)]
16    pub epoch: u64,
17    /// Encrypted call data.
18    pub data: Vec<u8>,
19}
20
21/// A result envelope when using the EncryptedX25519DeoxysII format.
22#[derive(Clone, Debug, Default, cbor::Encode, cbor::Decode)]
23pub struct ResultEnvelopeX25519DeoxysII {
24    /// Nonce.
25    pub nonce: [u8; deoxysii::NONCE_SIZE],
26    /// Encrypted call data.
27    pub data: Vec<u8>,
28}