crypto.aes #

Constants #

const (
	block_size = 16
)

fn new_cbc #

fn new_cbc(b AesCipher, iv []byte) AesCbc

new_cbc returns a AesCbc which encrypts in cipher block chaining mode, using the given Block. The length of iv must be the same as the Block's block size.

fn new_cipher #

fn new_cipher(key []byte) AesCipher

new_cipher creates and returns a new AesCipher. The key argument should be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.

fn (AesCbc) block_size #

fn (x &AesCbc) block_size() int

block_size returns the block size of the checksum in bytes.

fn (AesCbc) encrypt_blocks #

fn (x &AesCbc) encrypt_blocks(mut dst_ []byte, src_ []byte)

encrypt_blocks encrypts the blocks in src_ to dst_. Please note: dst_ is mutable for performance reasons.

fn (AesCbc) decrypt_blocks #

fn (mut x AesCbc) decrypt_blocks(mut dst []byte, src []byte)

decrypt_blocks decrypts the blocks in src to dst. Please note: dst is mutable for performance reasons.

fn (AesCipher) block_size #

fn (c &AesCipher) block_size() int

block_size returns the block size of the checksum in bytes.

fn (AesCipher) encrypt #

fn (c &AesCipher) encrypt(mut dst []byte, mut src []byte)

encrypt encrypts the blocks in src to dst. Please note: dst and src are both mutable for performance reasons.

fn (AesCipher) decrypt #

fn (c &AesCipher) decrypt(mut dst []byte, mut src []byte)

decrypt decrypts the blocks in src to dst. Please note: dst and src are both mutable for performance reasons.