// Generated by Lisette bindgen
// Source: crypto/mlkem (Go stdlib)
// Go: 1.25.10
// Lisette: 0.3.0

/// GenerateKey1024 generates a new decapsulation key, drawing random bytes from
/// the default crypto/rand source. The decapsulation key must be kept secret.
pub fn GenerateKey1024() -> Result<Ref<DecapsulationKey1024>, error>

/// GenerateKey768 generates a new decapsulation key, drawing random bytes from
/// the default crypto/rand source. The decapsulation key must be kept secret.
pub fn GenerateKey768() -> Result<Ref<DecapsulationKey768>, error>

/// NewDecapsulationKey1024 expands a decapsulation key from a 64-byte seed in the
/// "d || z" form. The seed must be uniformly random.
pub fn NewDecapsulationKey1024(seed: Slice<byte>) -> Result<Ref<DecapsulationKey1024>, error>

/// NewDecapsulationKey768 expands a decapsulation key from a 64-byte seed in the
/// "d || z" form. The seed must be uniformly random.
pub fn NewDecapsulationKey768(seed: Slice<byte>) -> Result<Ref<DecapsulationKey768>, error>

/// NewEncapsulationKey1024 parses an encapsulation key from its encoded form. If
/// the encapsulation key is not valid, NewEncapsulationKey1024 returns an error.
pub fn NewEncapsulationKey1024(encapsulationKey: Slice<byte>) -> Result<Ref<EncapsulationKey1024>, error>

/// NewEncapsulationKey768 parses an encapsulation key from its encoded form. If
/// the encapsulation key is not valid, NewEncapsulationKey768 returns an error.
pub fn NewEncapsulationKey768(encapsulationKey: Slice<byte>) -> Result<Ref<EncapsulationKey768>, error>

/// DecapsulationKey1024 is the secret key used to decapsulate a shared key
/// from a ciphertext. It includes various precomputed values.
pub type DecapsulationKey1024

/// DecapsulationKey768 is the secret key used to decapsulate a shared key
/// from a ciphertext. It includes various precomputed values.
pub type DecapsulationKey768

/// An EncapsulationKey1024 is the public key used to produce ciphertexts to be
/// decapsulated by the corresponding DecapsulationKey1024.
pub type EncapsulationKey1024

/// An EncapsulationKey768 is the public key used to produce ciphertexts to be
/// decapsulated by the corresponding DecapsulationKey768.
pub type EncapsulationKey768

pub const CiphertextSize1024 = 1568

pub const CiphertextSize768 = 1088

pub const EncapsulationKeySize1024 = 1568

pub const EncapsulationKeySize768 = 1184

pub const SeedSize = 64

pub const SharedKeySize = 32

impl DecapsulationKey1024 {
  /// Bytes returns the decapsulation key as a 64-byte seed in the "d || z" form.
  /// 
  /// The decapsulation key must be kept secret.
  fn Bytes(self: Ref<DecapsulationKey1024>) -> Slice<byte>

  /// Decapsulate generates a shared key from a ciphertext and a decapsulation
  /// key. If the ciphertext is not valid, Decapsulate returns an error.
  /// 
  /// The shared key must be kept secret.
  fn Decapsulate(self: Ref<DecapsulationKey1024>, ciphertext: Slice<byte>) -> Result<Slice<byte>, error>

  /// EncapsulationKey returns the public encapsulation key necessary to produce
  /// ciphertexts.
  fn EncapsulationKey(self: Ref<DecapsulationKey1024>) -> Ref<EncapsulationKey1024>
}

impl DecapsulationKey768 {
  /// Bytes returns the decapsulation key as a 64-byte seed in the "d || z" form.
  /// 
  /// The decapsulation key must be kept secret.
  fn Bytes(self: Ref<DecapsulationKey768>) -> Slice<byte>

  /// Decapsulate generates a shared key from a ciphertext and a decapsulation
  /// key. If the ciphertext is not valid, Decapsulate returns an error.
  /// 
  /// The shared key must be kept secret.
  fn Decapsulate(self: Ref<DecapsulationKey768>, ciphertext: Slice<byte>) -> Result<Slice<byte>, error>

  /// EncapsulationKey returns the public encapsulation key necessary to produce
  /// ciphertexts.
  fn EncapsulationKey(self: Ref<DecapsulationKey768>) -> Ref<EncapsulationKey768>
}

impl EncapsulationKey1024 {
  /// Bytes returns the encapsulation key as a byte slice.
  fn Bytes(self: Ref<EncapsulationKey1024>) -> Slice<byte>

  /// Encapsulate generates a shared key and an associated ciphertext from an
  /// encapsulation key, drawing random bytes from the default crypto/rand source.
  /// 
  /// The shared key must be kept secret.
  fn Encapsulate(self: Ref<EncapsulationKey1024>) -> (Slice<byte>, Slice<byte>)
}

impl EncapsulationKey768 {
  /// Bytes returns the encapsulation key as a byte slice.
  fn Bytes(self: Ref<EncapsulationKey768>) -> Slice<byte>

  /// Encapsulate generates a shared key and an associated ciphertext from an
  /// encapsulation key, drawing random bytes from the default crypto/rand source.
  /// 
  /// The shared key must be kept secret.
  fn Encapsulate(self: Ref<EncapsulationKey768>) -> (Slice<byte>, Slice<byte>)
}
