1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

Single-DES encryption, patch courtesy of Murphy Lam

[originally from svn r253]
This commit is contained in:
Simon Tatham
1999-10-25 08:59:40 +00:00
parent 2da19fc59d
commit 2d6fcb0a7a
7 changed files with 54 additions and 5 deletions

View File

@ -673,6 +673,27 @@ struct ssh_cipher ssh_3des = {
des3_decrypt_blk
};
static void des_sesskey(unsigned char *key) {
des_set_key(key, &ekey1);
memset(eiv1, 0, sizeof(eiv1));
des_set_key(key, &dkey1);
memset(div1, 0, sizeof(div1));
}
static void des_encrypt_blk(unsigned char *blk, int len) {
des_cbc_encrypt(&ekey1, eiv1, blk, blk, len);
}
static void des_decrypt_blk(unsigned char *blk, int len) {
des_cbc_decrypt(&dkey1, div1, blk, blk, len);
}
struct ssh_cipher ssh_des = {
des_sesskey,
des_encrypt_blk,
des_decrypt_blk
};
#ifdef DES_TEST
void des_encrypt_buf(DESContext *ks, unsigned char *out,