const BLOCK_SIZE
pub const BLOCK_SIZE = 8Purpose
Constant BLOCK_SIZE, defining protocol or algorithm parameters.
#crypto/desDES / 3DES-EDE single block.
const BLOCK_SIZEpub const BLOCK_SIZE = 8Constant BLOCK_SIZE, defining protocol or algorithm parameters.
struct Cipherpub struct Cipher {
pub subkeys []int
}Des Cipher context for block or stream encryption/decryption.
subkeys []intstruct TripleCipherpub struct TripleCipher {
pub k1 []int
pub k2 []int
pub k3 []int
}Des Cipher context for block or stream encryption/decryption.
k1 []intk2 []intk3 []intnew_cipherpub fn new_cipher(key &string) CipherConstruct cipher. Throws on failure; handle the error or propagate it to the caller.
key &stringCipher — a value of this type
(&Cipher) block_sizepub fn (c &Cipher) block_size() intOperation on &Cipher: block size.
c &CipherCipher instance used by this call (borrow).int — a value of this type
(&Cipher) encryptpub fn (c &Cipher) encrypt(src &string) stringOperation on &Cipher: encrypt.
c &CipherCipher instance used by this call (borrow).src &stringstring — result string
(&Cipher) decryptpub fn (c &Cipher) decrypt(src &string) stringOperation on &Cipher: decrypt.
c &CipherCipher instance used by this call (borrow).src &stringstring — result string
new_triple_cipherpub fn new_triple_cipher(key &string) TripleCipherConstruct triple cipher. Throws on failure; handle the error or propagate it to the caller.
key &stringTripleCipher — a value of this type
(&TripleCipher) encryptpub fn (c &TripleCipher) encrypt(src &string) stringOperation on &TripleCipher: encrypt. Throws on failure; handle the error or propagate it to the caller.
c &TripleCipherTripleCipher instance used by this call (borrow).src &stringstring — result string
(&TripleCipher) decryptpub fn (c &TripleCipher) decrypt(src &string) stringOperation on &TripleCipher: decrypt. Throws on failure; handle the error or propagate it to the caller.
c &TripleCipherTripleCipher instance used by this call (borrow).src &stringstring — result string