Module crypto.cipher stdlib

crypto.cipher
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
1
Imported by:
2
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

Aliases

This section is empty.

Constants

This section is empty.

Sum types

This section is empty.

Functions

#fn new_cbc

fn new_cbc(b Block, iv []u8) Cbc

new_cbc returns a DesCbc 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_cfb_decrypter

fn new_cfb_decrypter(b Block, iv []u8) Cfb

new_cfb_decrypter returns a Cfb which decrypts with cipher feedback mode, using the given Block. The iv must be the same length as the Block's block size

#fn new_cfb_encrypter

fn new_cfb_encrypter(b Block, iv []u8) Cfb

new_cfb_encrypter returns a Cfb which encrypts with cipher feedback mode, using the given Block. The iv must be the same length as the Block's block size

#fn new_ctr

fn new_ctr(b Block, iv []u8) Ctr

new_ctr returns a Ctr which encrypts/decrypts using the given Block in counter mode. The length of iv must be the same as the Block's block size.

#fn new_ofb

fn new_ofb(b Block, iv []u8) Ofb

new_ofb returns a Ofb that encrypts or decrypts using the block cipher b in output feedback mode. The initialization vector iv's length must be equal to b's block size.

#fn safe_xor_bytes

fn safe_xor_bytes(mut dst &[]u8, a []u8, b []u8, n int)

safe_xor_bytes XORs the bytes in a and b into dst it does so n times.

Please note: n needs to be smaller or equal than the length of a and b.

#fn xor_bytes

fn xor_bytes(mut dst &[]u8, a []u8, b []u8) int

NOTE: Implement other versions (joe-c) xor_bytes xors the bytes in a and b. The destination should have enough space, otherwise xor_bytes will panic. Returns the number of bytes xor'd.

#fn xor_words

fn xor_words(mut dst &[]u8, a []u8, b []u8)

xor_words XORs multiples of 4 or 8 bytes (depending on architecture.) The slice arguments a and b are assumed to be of equal length.

Structs

This section is empty.

Interfaces

This section is empty.

Enums

This section is empty.