Fix unnecessarily direction-specific tests in cipher_tests.txt

All our EVP_CIPHERs are deterministic, so there's usually no point in
testing only one direction. Some of the ECB tests were missing free
decryption tests. CTR is the same in both directions, but we ought to
test the API agrees. OFB vectors are doubled up, so we can merge them
together. Plus there are typos in the OFB-AES192.Decrypt tests, also
present upstream, so we weren't actually testing everything we should.

(I haven't removed the direction-specific logic altogether since the
tests imported from nist_cavp rely on it. Though there may be something
to be said for running them both ways since they don't actually double
them up...)

Change-Id: I36a77d342afa436e89ad244a87567e1a4c6ee9dc
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/46284
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
diff --git a/crypto/cipher_extra/test/cipher_tests.txt b/crypto/cipher_extra/test/cipher_tests.txt
index ced7595..52fd4af 100644
--- a/crypto/cipher_extra/test/cipher_tests.txt
+++ b/crypto/cipher_extra/test/cipher_tests.txt
@@ -109,7 +109,6 @@
 # AES 128 ECB tests (from FIPS-197 test vectors, encrypt)
 Cipher = AES-128-ECB
 Key = 000102030405060708090A0B0C0D0E0F
-Operation = ENCRYPT
 Plaintext = 00112233445566778899AABBCCDDEEFF
 Ciphertext = 69C4E0D86A7B0430D8CDB78070B4C55A
 
@@ -117,7 +116,6 @@
 # AES 256 ECB tests (from FIPS-197 test vectors, encrypt)
 Cipher = AES-256-ECB
 Key = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
-Operation = ENCRYPT
 Plaintext = 00112233445566778899AABBCCDDEEFF
 Ciphertext = 8EA2B7CA516745BFEAFC49904B496089
 
@@ -227,42 +225,36 @@
 Cipher = AES-128-CTR
 Key = AE6852F8121067CC4BF7A5765577F39E
 IV = 00000030000000000000000000000001
-Operation = ENCRYPT
 Plaintext = 53696E676C6520626C6F636B206D7367
 Ciphertext = E4095D4FB7A7B3792D6175A3261311B8
 
 Cipher = AES-128-CTR
 Key = 7E24067817FAE0D743D6CE1F32539163
 IV = 006CB6DBC0543B59DA48D90B00000001
-Operation = ENCRYPT
 Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
 Ciphertext = 5104A106168A72D9790D41EE8EDAD388EB2E1EFC46DA57C8FCE630DF9141BE28
 
 Cipher = AES-128-CTR
 Key = 7691BE035E5020A8AC6E618529F9A0DC
 IV = 00E0017B27777F3F4A1786F000000001
-Operation = ENCRYPT
 Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223
 Ciphertext = C1CF48A89F2FFDD9CF4652E9EFDB72D74540A42BDE6D7836D59A5CEAAEF3105325B2072F
 
 Cipher = AES-256-CTR
 Key = 776BEFF2851DB06F4C8A0542C8696F6C6A81AF1EEC96B4D37FC1D689E6C1C104
 IV = 00000060DB5672C97AA8F0B200000001
-Operation = ENCRYPT
 Plaintext = 53696E676C6520626C6F636B206D7367
 Ciphertext = 145AD01DBF824EC7560863DC71E3E0C0
 
 Cipher = AES-256-CTR
 Key = F6D66D6BD52D59BB0796365879EFF886C66DD51A5B6A99744B50590C87A23884
 IV = 00FAAC24C1585EF15A43D87500000001
-Operation = ENCRYPT
 Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
 Ciphertext = F05E231B3894612C49EE000B804EB2A9B8306B508F839D6A5530831D9344AF1C
 
 Cipher = AES-256-CTR
 Key = FF7A617CE69148E4F1726E2F43581DE2AA62D9F805532EDFF1EED687FB54153D
 IV = 001CC5B751A51D70A1C1114800000001
-Operation = ENCRYPT
 Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F20212223
 Ciphertext = EB6C52821D0BBBF7CE7594462ACA4FAAB407DF866569FD07F48CC0B583D6071F1EC0E6B8
 
@@ -270,7 +262,6 @@
 Cipher = AES-128-CTR
 Key = 7E24067817FAE0D743D6CE1F32539163
 IV = 00000000000000007FFFFFFFFFFFFFFF
-Operation = ENCRYPT
 Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
 Ciphertext = A2D459477E6432BD74184B1B5370D2243CDC202BC43583B2A55D288CDBBD1E03
 
@@ -462,178 +453,78 @@
 
 # OFB tests from OpenSSL upstream.
 
-# OFB-AES128.Encrypt
+# OFB-AES128
 Cipher = AES-128-OFB
 Key = 2B7E151628AED2A6ABF7158809CF4F3C
 IV = 000102030405060708090A0B0C0D0E0F
-Operation = ENCRYPT
 Plaintext = 6BC1BEE22E409F96E93D7E117393172A
 Ciphertext = 3B3FD92EB72DAD20333449F8E83CFB4A
 
 Cipher = AES-128-OFB
 Key = 2B7E151628AED2A6ABF7158809CF4F3C
 IV = 50FE67CC996D32B6DA0937E99BAFEC60
-Operation = ENCRYPT
 Plaintext = AE2D8A571E03AC9C9EB76FAC45AF8E51
 Ciphertext = 7789508D16918F03F53C52DAC54ED825
 
 Cipher = AES-128-OFB
 Key = 2B7E151628AED2A6ABF7158809CF4F3C
 IV = D9A4DADA0892239F6B8B3D7680E15674
-Operation = ENCRYPT
 Plaintext = 30C81C46A35CE411E5FBC1191A0A52EF
 Ciphertext = 9740051E9C5FECF64344F7A82260EDCC
 
 Cipher = AES-128-OFB
 Key = 2B7E151628AED2A6ABF7158809CF4F3C
 IV = A78819583F0308E7A6BF36B1386ABF23
-Operation = ENCRYPT
 Plaintext = F69F2445DF4F9B17AD2B417BE66C3710
 Ciphertext = 304C6528F659C77866A510D9C1D6AE5E
 
-# OFB-AES128.Decrypt
-Cipher = AES-128-OFB
-Key = 2B7E151628AED2A6ABF7158809CF4F3C
-IV = 000102030405060708090A0B0C0D0E0F
-Operation = DECRYPT
-Plaintext = 6BC1BEE22E409F96E93D7E117393172A
-Ciphertext = 3B3FD92EB72DAD20333449F8E83CFB4A
-
-Cipher = AES-128-OFB
-Key = 2B7E151628AED2A6ABF7158809CF4F3C
-IV = 50FE67CC996D32B6DA0937E99BAFEC60
-Operation = DECRYPT
-Plaintext = AE2D8A571E03AC9C9EB76FAC45AF8E51
-Ciphertext = 7789508D16918F03F53C52DAC54ED825
-
-Cipher = AES-128-OFB
-Key = 2B7E151628AED2A6ABF7158809CF4F3C
-IV = D9A4DADA0892239F6B8B3D7680E15674
-Operation = DECRYPT
-Plaintext = 30C81C46A35CE411E5FBC1191A0A52EF
-Ciphertext = 9740051E9C5FECF64344F7A82260EDCC
-
-Cipher = AES-128-OFB
-Key = 2B7E151628AED2A6ABF7158809CF4F3C
-IV = A78819583F0308E7A6BF36B1386ABF23
-Operation = DECRYPT
-Plaintext = F69F2445DF4F9B17AD2B417BE66C3710
-Ciphertext = 304C6528F659C77866A510D9C1D6AE5E
-
-# OFB-AES192.Encrypt
+# OFB-AES192
 Cipher = AES-192-OFB
 Key = 8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B
 IV = 000102030405060708090A0B0C0D0E0F
-Operation = ENCRYPT
 Plaintext = 6BC1BEE22E409F96E93D7E117393172A
 Ciphertext = CDC80D6FDDF18CAB34C25909C99A4174
 
 Cipher = AES-192-OFB
 Key = 8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B
 IV = A609B38DF3B1133DDDFF2718BA09565E
-Operation = ENCRYPT
 Plaintext = AE2D8A571E03AC9C9EB76FAC45AF8E51
 Ciphertext = FCC28B8D4C63837C09E81700C1100401
 
 Cipher = AES-192-OFB
 Key = 8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B
 IV = 52EF01DA52602FE0975F78AC84BF8A50
-Operation = ENCRYPT
 Plaintext = 30C81C46A35CE411E5FBC1191A0A52EF
 Ciphertext = 8D9A9AEAC0F6596F559C6D4DAF59A5F2
 
 Cipher = AES-192-OFB
 Key = 8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B
 IV = BD5286AC63AABD7EB067AC54B553F71D
-Operation = ENCRYPT
 Plaintext = F69F2445DF4F9B17AD2B417BE66C3710
 Ciphertext = 6D9F200857CA6C3E9CAC524BD9ACC92A
 
-# OFB-AES192.Decrypt
-Cipher = AES-192-OFB
-Key = 8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B
-IV = 000102030405060708090A0B0C0D0E0F
-Operation = ENCRYPT
-Plaintext = 6BC1BEE22E409F96E93D7E117393172A
-Ciphertext = CDC80D6FDDF18CAB34C25909C99A4174
-
-Cipher = AES-192-OFB
-Key = 8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B
-IV = A609B38DF3B1133DDDFF2718BA09565E
-Operation = ENCRYPT
-Plaintext = AE2D8A571E03AC9C9EB76FAC45AF8E51
-Ciphertext = FCC28B8D4C63837C09E81700C1100401
-
-Cipher = AES-192-OFB
-Key = 8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B
-IV = 52EF01DA52602FE0975F78AC84BF8A50
-Operation = ENCRYPT
-Plaintext = 30C81C46A35CE411E5FBC1191A0A52EF
-Ciphertext = 8D9A9AEAC0F6596F559C6D4DAF59A5F2
-
-Cipher = AES-192-OFB
-Key = 8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B
-IV = BD5286AC63AABD7EB067AC54B553F71D
-Operation = ENCRYPT
-Plaintext = F69F2445DF4F9B17AD2B417BE66C3710
-Ciphertext = 6D9F200857CA6C3E9CAC524BD9ACC92A
-
-# OFB-AES256.Encrypt
+# OFB-AES256
 Cipher = AES-256-OFB
 Key = 603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4
 IV = 000102030405060708090A0B0C0D0E0F
-Operation = ENCRYPT
 Plaintext = 6BC1BEE22E409F96E93D7E117393172A
 Ciphertext = DC7E84BFDA79164B7ECD8486985D3860
 
 Cipher = AES-256-OFB
 Key = 603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4
 IV = B7BF3A5DF43989DD97F0FA97EBCE2F4A
-Operation = ENCRYPT
 Plaintext = AE2D8A571E03AC9C9EB76FAC45AF8E51
 Ciphertext = 4FEBDC6740D20B3AC88F6AD82A4FB08D
 
 Cipher = AES-256-OFB
 Key = 603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4
 IV = E1C656305ED1A7A6563805746FE03EDC
-Operation = ENCRYPT
 Plaintext = 30C81C46A35CE411E5FBC1191A0A52EF
 Ciphertext = 71AB47A086E86EEDF39D1C5BBA97C408
 
 Cipher = AES-256-OFB
 Key = 603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4
 IV = 41635BE625B48AFC1666DD42A09D96E7
-Operation = ENCRYPT
-Plaintext = F69F2445DF4F9B17AD2B417BE66C3710
-Ciphertext = 0126141D67F37BE8538F5A8BE740E484
-
-
-# OFB-AES256.Decrypt
-Cipher = AES-256-OFB
-Key = 603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4
-IV = 000102030405060708090A0B0C0D0E0F
-Operation = DECRYPT
-Plaintext = 6BC1BEE22E409F96E93D7E117393172A
-Ciphertext = DC7E84BFDA79164B7ECD8486985D3860
-
-Cipher = AES-256-OFB
-Key = 603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4
-IV = B7BF3A5DF43989DD97F0FA97EBCE2F4A
-Operation = DECRYPT
-Plaintext = AE2D8A571E03AC9C9EB76FAC45AF8E51
-Ciphertext = 4FEBDC6740D20B3AC88F6AD82A4FB08D
-
-Cipher = AES-256-OFB
-Key = 603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4
-IV = E1C656305ED1A7A6563805746FE03EDC
-Operation = DECRYPT
-Plaintext = 30C81C46A35CE411E5FBC1191A0A52EF
-Ciphertext = 71AB47A086E86EEDF39D1C5BBA97C408
-
-Cipher = AES-256-OFB
-Key = 603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4
-IV = 41635BE625B48AFC1666DD42A09D96E7
-Operation = DECRYPT
 Plaintext = F69F2445DF4F9B17AD2B417BE66C3710
 Ciphertext = 0126141D67F37BE8538F5A8BE740E484
 
@@ -667,7 +558,6 @@
 # AES-192-ECB tests from FIPS-197
 Cipher = AES-192-ECB
 Key = 000102030405060708090A0B0C0D0E0F1011121314151617
-Operation = ENCRYPT
 Plaintext = 00112233445566778899AABBCCDDEEFF
 Ciphertext = DDA97CA4864CDFE06EAF70A0EC0D7191