View Source SimpleRijndael (simple-rijndael v0.1.0)

Wrapper module to interact with the Rust NIF for the simple_rijndael Rust crate.

Summary

Types

The error types that can be returned by the NIF.

The padding types that can be used for the Rijndael cipher.

Functions

Decrypts the given data using the Rijndael cipher and the given initialization vector.

Encrypts the given data using the Rijndael cipher and the given initialization vector.

Initializes the low-level Rijndael struct in CBC mode with the given key, block size (in bytes), and padding.

Types

@type error() :: :invalid_data_size | :invalid_block_size | :invalid_key_size

The error types that can be returned by the NIF.

@type padding() :: :pkcs7 | :zero

The padding types that can be used for the Rijndael cipher.

Functions

Link to this function

decrypt(cipher, iv, data)

View Source
@spec decrypt(reference(), binary(), binary()) :: {:ok, binary()} | {:error, error()}

Decrypts the given data using the Rijndael cipher and the given initialization vector.

Link to this function

encrypt(cipher, iv, data)

View Source
@spec encrypt(reference(), binary(), binary()) :: {:ok, binary()} | {:error, error()}

Encrypts the given data using the Rijndael cipher and the given initialization vector.

Link to this function

init_cbc_mode(key, block_size, padding)

View Source
@spec init_cbc_mode(binary(), non_neg_integer(), padding()) ::
  {:ok, reference()} | {:error, error()}

Initializes the low-level Rijndael struct in CBC mode with the given key, block size (in bytes), and padding.