henesyinit from p9fd787fda5 years agoHistory
40 lines · 631 B · C
RawDownload
#include "ssh.h" struct CipherState{	BFstate enc;	BFstate dec;}; static CipherState*initblowfish(Conn *c, int){	CipherState *cs; 	cs = emalloc(sizeof(CipherState));	setupBFstate(&cs->enc, c->sesskey, SESSKEYLEN, nil);	setupBFstate(&cs->dec, c->sesskey, SESSKEYLEN, nil);	return cs;} static voidencryptblowfish(CipherState *cs, uchar *buf, int nbuf){	bfCBCencrypt(buf, nbuf, &cs->enc);} static voiddecryptblowfish(CipherState *cs, uchar *buf, int nbuf){	bfCBCdecrypt(buf, nbuf, &cs->dec);} Cipher cipherblowfish = {	SSH_CIPHER_BLOWFISH,	"blowfish",	initblowfish,	encryptblowfish,	decryptblowfish,};