Exemple #1
0
func testDecBulk(t *testing.T, kIdx int, cipher block.Cipher, cipherTexts [][][]byte) {
	result := make([]byte, 8)
	for j, plain := range plainTextBlocks {
		cipher.Decrypt(result, cipherTexts[j][kIdx])
		if 1 != subtle.ConstantTimeCompare(result, plain) {
			t.Errorf("? DES #%d decrypt failed with plaintext #%d", j, kIdx)
		}
	}
}
Exemple #2
0
func gen_iv(c block.Cipher) []byte {
	return make([]byte, c.BlockSize())
}