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

import "go:hash"

/// New224 creates a new SHA3-224 hash.
pub fn New224() -> Ref<SHA3>

/// New256 creates a new SHA3-256 hash.
pub fn New256() -> Ref<SHA3>

/// New384 creates a new SHA3-384 hash.
pub fn New384() -> Ref<SHA3>

/// New512 creates a new SHA3-512 hash.
pub fn New512() -> Ref<SHA3>

/// NewCSHAKE128 creates a new cSHAKE128 XOF.
/// 
/// N is used to define functions based on cSHAKE, it can be empty when plain
/// cSHAKE is desired. S is a customization byte string used for domain
/// separation. When N and S are both empty, this is equivalent to NewSHAKE128.
pub fn NewCSHAKE128(n: Slice<byte>, s: Slice<byte>) -> Ref<SHAKE>

/// NewCSHAKE256 creates a new cSHAKE256 XOF.
/// 
/// N is used to define functions based on cSHAKE, it can be empty when plain
/// cSHAKE is desired. S is a customization byte string used for domain
/// separation. When N and S are both empty, this is equivalent to NewSHAKE256.
pub fn NewCSHAKE256(n: Slice<byte>, s: Slice<byte>) -> Ref<SHAKE>

/// NewSHAKE128 creates a new SHAKE128 XOF.
pub fn NewSHAKE128() -> Ref<SHAKE>

/// NewSHAKE256 creates a new SHAKE256 XOF.
pub fn NewSHAKE256() -> Ref<SHAKE>

/// Sum224 returns the SHA3-224 hash of data.
#[go(array_return)]
pub fn Sum224(data: Slice<byte>) -> Slice<byte>

/// Sum256 returns the SHA3-256 hash of data.
#[go(array_return)]
pub fn Sum256(data: Slice<byte>) -> Slice<byte>

/// Sum384 returns the SHA3-384 hash of data.
#[go(array_return)]
pub fn Sum384(data: Slice<byte>) -> Slice<byte>

/// Sum512 returns the SHA3-512 hash of data.
#[go(array_return)]
pub fn Sum512(data: Slice<byte>) -> Slice<byte>

/// SumSHAKE128 applies the SHAKE128 extendable output function to data and
/// returns an output of the given length in bytes.
pub fn SumSHAKE128(data: Slice<byte>, length: int) -> Slice<byte>

/// SumSHAKE256 applies the SHAKE256 extendable output function to data and
/// returns an output of the given length in bytes.
pub fn SumSHAKE256(data: Slice<byte>, length: int) -> Slice<byte>

/// SHA3 is an instance of a SHA-3 hash. It implements [hash.Hash].
pub type SHA3

/// SHAKE is an instance of a SHAKE extendable output function.
pub type SHAKE

impl SHA3 {
  /// AppendBinary implements [encoding.BinaryAppender].
  fn AppendBinary(self: Ref<SHA3>, mut p: Slice<byte>) -> Result<Slice<byte>, error>

  /// BlockSize returns the hash's rate.
  fn BlockSize(self: Ref<SHA3>) -> int

  /// Clone implements [hash.Cloner].
  fn Clone(self: Ref<SHA3>) -> Result<hash.Cloner, error>

  /// MarshalBinary implements [encoding.BinaryMarshaler].
  fn MarshalBinary(self: Ref<SHA3>) -> Result<Slice<byte>, error>

  /// Reset resets the hash to its initial state.
  fn Reset(self: Ref<SHA3>)

  /// Size returns the number of bytes Sum will produce.
  fn Size(self: Ref<SHA3>) -> int

  /// Sum appends the current hash to b and returns the resulting slice.
  fn Sum(self: Ref<SHA3>, mut b: Slice<byte>) -> Slice<byte>

  /// UnmarshalBinary implements [encoding.BinaryUnmarshaler].
  fn UnmarshalBinary(self: Ref<SHA3>, data: Slice<byte>) -> Result<(), error>

  /// Write absorbs more data into the hash's state.
  fn Write(self: Ref<SHA3>, p: Slice<byte>) -> Partial<int, error>
}

impl SHAKE {
  /// AppendBinary implements [encoding.BinaryAppender].
  fn AppendBinary(self: Ref<SHAKE>, mut p: Slice<byte>) -> Result<Slice<byte>, error>

  /// BlockSize returns the rate of the XOF.
  fn BlockSize(self: Ref<SHAKE>) -> int

  /// MarshalBinary implements [encoding.BinaryMarshaler].
  fn MarshalBinary(self: Ref<SHAKE>) -> Result<Slice<byte>, error>

  /// Read squeezes more output from the XOF.
  /// 
  /// Any call to Write after a call to Read will panic.
  fn Read(self: Ref<SHAKE>, mut p: Slice<byte>) -> Partial<int, error>

  /// Reset resets the XOF to its initial state.
  fn Reset(self: Ref<SHAKE>)

  /// UnmarshalBinary implements [encoding.BinaryUnmarshaler].
  fn UnmarshalBinary(self: Ref<SHAKE>, data: Slice<byte>) -> Result<(), error>

  /// Write absorbs more data into the XOF's state.
  /// 
  /// It panics if any output has already been read.
  fn Write(self: Ref<SHAKE>, p: Slice<byte>) -> Partial<int, error>
}
