summaryrefslogtreecommitdiff
path: root/sys/src/cmd/ssh/ciphertwiddle.c
blob: 4b3088eb14829303fe224290c94dbb4ac3e4a65d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "ssh.h"

static CipherState*
inittwiddle(Conn *c, int)
{
	/* must be non-nil */
	fprint(2, "twiddle key is %.*H\n", SESSKEYLEN, c->sesskey);
	return (CipherState*)~0;
}

static void
twiddle(CipherState*, uchar *buf, int n)
{
	int i;

	for(i=0; i<n; i++)
		buf[i] ^= 0xFF;
}

Cipher ciphertwiddle =
{
	SSH_CIPHER_TWIDDLE,
	"twiddle",
	inittwiddle,
	twiddle,
	twiddle,
};