예제 #1
0
func AS_aes256_ofb(key []byte) AuthStreamer {
	cryptkey := hash_keyed(key, "cryptkey")[:32]
	hashkey := hash_keyed(key, "hashkey")
	streamstate := fastTF_NewOFB(cryptkey)
	truestate := cipher.Stream(streamstate)
	toret := __XOR_authstreamer{
		0,
		hashkey,
		truestate}
	return AuthStreamer(toret)
}
예제 #2
0
func AS_aes128_ctr(key []byte) AuthStreamer {
	cryptkey := hash_keyed(key, "cryptkey")[:16]
	hashkey := hash_keyed(key, "hashkey")
	blockstate := fastAES_initialize(cryptkey)
	streamstate := cipher.NewCTR(blockstate, make([]byte, blockstate.BlockSize()))
	truestate := cipher.Stream(streamstate)
	toret := __XOR_authstreamer{
		0,
		hashkey,
		truestate}
	return AuthStreamer(toret)
}
예제 #3
0
func AS_arcfour128_drop8192(key []byte) AuthStreamer {
	cryptkey := hash_keyed(key, "cryptkey")
	hashkey := hash_keyed(key, "hashkey")
	streamstate, _ := rc4.NewCipher(cryptkey[:16])
	truestate := cipher.Stream(streamstate)
	junk := make([]byte, 8192)
	truestate.XORKeyStream(junk, junk)
	toret := __XOR_authstreamer{
		0,
		hashkey,
		truestate}
	return AuthStreamer(toret)
}