gpkm/sav/blocks

Types

pub type Action {
  Encrypt
  Decrypt
}

Constructors

  • Encrypt
  • Decrypt
pub type Blocks {
  Blocks(a: Bytes, b: Bytes, c: Bytes, d: Bytes)
}

Constructors

  • Blocks(a: Bytes, b: Bytes, c: Bytes, d: Bytes)

Functions

pub fn blocks_as_bytes(bs: Blocks) -> List(Int)
pub fn bytes_as_blocks(bs: List(Int)) -> Blocks

Construct Blocks record from block bytes. Each block is 32 bytes long

pub fn rand(seed: Int) -> Int
pub fn shift_personality_value(pid: List(Int)) -> Int

Shift personality value (PV, a.k.a: pid) accoring to the following formula:

shift = ((PV & 0x3E000) >> 0xD) % 24
pub fn shuffle_block_bytes(
  bs: List(Int),
  pid: List(Int),
  ord: Action,
) -> List(Int)

Shuffle blocks according to the specifies rules

Search Document