module

Matter::Crypto::AES::WordArrayHelper

Class methods

bytes_to_block(bytes : Bytes, block : WordArray, byte_offset : Int32 = 0)

Copy bytes into a 4-word block. If input is too short, sets missing bytes to zero.

Source
create(length : Int32) : WordArray

Create a new word array with specified length

Source
from_bytes(bytes : Bytes, alignment : Int32 = 1) : WordArray

Convert byte array to word array

Source
read_int32_be(bytes : Bytes, offset : Int32) : Int32

Read big-endian Int32 from bytes

Source
read_int32_platform(bytes : Bytes, offset : Int32) : Int32

Read platform-endian Int32 from bytes

Source
read_partial_word(bytes : Bytes, offset : Int32, bytes_available : Int32 | Nil = nil) : Int32

Read a word from a byte array that may be smaller than four bytes (big-endian)

Source
write_int32_be(bytes : Bytes, offset : Int32, value : Int32)

Write big-endian Int32 to bytes

Source
write_int32_platform(bytes : Bytes, offset : Int32, value : Int32)

Write platform-endian Int32 to bytes

Source
write_partial_word(word : Int32, bytes : Bytes, offset : Int32, bytes_available : Int32 | Nil = nil)

Write a partial word to a byte array (big-endian)

Source