@@ -56,6 +56,7 @@ fn (mut c DesCipher) generate_subkeys(key_bytes []u8) {
56
56
}
57
57
}
58
58
59
+ // encrypt a block of data using the DES algorithm
59
60
pub fn (c &DesCipher) encrypt (mut dst []u8 , src []u8 ) {
60
61
if src.len < block_size {
61
62
panic ('crypto/des: input not full block' )
@@ -69,6 +70,7 @@ pub fn (c &DesCipher) encrypt(mut dst []u8, src []u8) {
69
70
encrypt_block (c.subkeys[..], mut dst, src)
70
71
}
71
72
73
+ // decrypt a block of data using the DES algorithm
72
74
pub fn (c &DesCipher) decrypt (mut dst []u8 , src []u8 ) {
73
75
if src.len < block_size {
74
76
panic ('crypto/des: input not full block' )
@@ -94,6 +96,7 @@ pub fn new_triple_des_cipher(key []u8) cipher.Block {
94
96
return c
95
97
}
96
98
99
+ // encrypt a block of data using the TripleDES algorithm
97
100
pub fn (c &TripleDesCipher) encrypt (mut dst []u8 , src []u8 ) {
98
101
if src.len < block_size {
99
102
panic ('crypto/des: input not full block' )
@@ -130,6 +133,7 @@ pub fn (c &TripleDesCipher) encrypt(mut dst []u8, src []u8) {
130
133
binary.big_endian_put_u64 (mut dst, permute_final_block (pre_output))
131
134
}
132
135
136
+ // decrypt a block of data using the TripleDES algorithm
133
137
pub fn (c &TripleDesCipher) decrypt (mut dst []u8 , src []u8 ) {
134
138
if src.len < block_size {
135
139
panic ('crypto/des: input not full block' )
0 commit comments