~apreiml/hare-ssh

c4d30bdcbfa0b48c1796966170fbf6906d13d1f6 — Drew DeVault 1 year, 7 months ago bf27f21
Updates per crypto::aes changes
2 files changed, 5 insertions(+), 5 deletions(-)

M format/ssh/cipher.ha
M net/ssh/cipher.ha
M format/ssh/cipher.ha => format/ssh/cipher.ha +3 -3
@@ 35,16 35,16 @@ fn getcipher(name: str) (const *cipher | badcipher) = {

type aes256ctr = struct {
	st: cipher::ctr_stream,
	block: aes::ct64_block,
	block: aes::block,
	buf: [aes::CTR_BUFSIZE]u8,
};

fn aes256ctr_init(handle: io::handle, key: []u8, iv: []u8) *io::stream = {
	let state = alloc(aes256ctr {
		block = aes::ct64(),
		block = aes::aes(),
		...
	});
	aes::ct64_init(&state.block, key);
	aes::init(&state.block, key);
	state.st = cipher::ctr(handle, &state.block, iv, state.buf);
	return state;
};

M net/ssh/cipher.ha => net/ssh/cipher.ha +2 -2
@@ 94,7 94,7 @@ export fn cipher_lookup(name: str) const nullable *cipher = {

type aes_ctr = struct {
	cipher,
	ct: aes::ct64_block,
	ct: aes::block,
	ctr: cipher::ctr_stream,
	ctrbuf: [aes::CTR_BUFSIZE]u8,
};


@@ 110,7 110,7 @@ fn aes256_ctr_init(
	const shared = kex_shared(kex);
	kex_hash(client, kex, hash_type::IV_CLIENT_SERVER, shared, iv);
	kex_hash(client, kex, hash_type::ENCRYPT_CLIENT_SERVER, shared, key);
	cipher.ct = aes::ct64();
	cipher.ct = aes::aes();
	cipher.ctr = cipher::ctr(handle, &cipher.ct, iv, cipher.ctrbuf);
	return cipher;
};