Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_unix/sys/src/cmd/ssh1/cipherblowfish.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include "ssh.h"
2
 
3
struct CipherState
4
{
5
	BFstate enc;
6
	BFstate dec;
7
};
8
 
9
static CipherState*
10
initblowfish(Conn *c, int)
11
{
12
	CipherState *cs;
13
 
14
	cs = emalloc(sizeof(CipherState));
15
	setupBFstate(&cs->enc, c->sesskey, SESSKEYLEN, nil);
16
	setupBFstate(&cs->dec, c->sesskey, SESSKEYLEN, nil);
17
	return cs;
18
}
19
 
20
static void
21
encryptblowfish(CipherState *cs, uchar *buf, int nbuf)
22
{
23
	bfCBCencrypt(buf, nbuf, &cs->enc);
24
}
25
 
26
static void
27
decryptblowfish(CipherState *cs, uchar *buf, int nbuf)
28
{
29
	bfCBCdecrypt(buf, nbuf, &cs->dec);
30
}
31
 
32
Cipher cipherblowfish = 
33
{
34
	SSH_CIPHER_BLOWFISH,
35
	"blowfish",
36
	initblowfish,
37
	encryptblowfish,
38
	decryptblowfish,
39
};
40