17 #include <gtest/gtest.h>
19 #include "../../crypto/internal.h"
20 #include "../../crypto/test/test_util.h"
34 {0xbb, 0x56, 0xb1, 0x27, 0x7c, 0x4c, 0xdd, 0x5a, 0x99, 0x90, 0x1e, 0x6f,
35 0xeb, 0x36, 0x6c, 0xf3},
36 {0xa6, 0x5b, 0xe0, 0x99, 0xad, 0x5d, 0x91, 0x98, 0x37, 0xc1, 0xa4, 0x7f,
37 0x01, 0x24, 0x9a, 0x6b},
38 {0xd5, 0x8a, 0x5c, 0x29, 0xeb, 0xee, 0xed, 0x76},
39 {0xda, 0x6e, 0x18, 0x9c, 0x03, 0x59, 0x12, 0x61, 0xfa, 0x20, 0xd9, 0xce,
40 0xee, 0x43, 0x9d, 0x05},
41 {0x4f, 0x8b, 0x3e, 0x17, 0xa5, 0x35, 0x9b, 0xcb,
42 0xdf, 0x3c, 0x52, 0xfb, 0xe5, 0x20, 0xdd, 0x53,
43 0xd5, 0xf8, 0x1a, 0x6c, 0xf0, 0x99, 0x34, 0x94},
44 {0xfd, 0x65, 0xc5, 0xa6, 0x07, 0x07, 0xb5, 0xf3, 0x2e, 0xfb, 0x12, 0xc3,
45 0x7f, 0x45, 0x37, 0x54},
48 {0x5d, 0x98, 0xa9, 0xd2, 0x27, 0x5d, 0xc8, 0x8c, 0x8c, 0xee, 0x23, 0x7f,
49 0x8e, 0x2b, 0xd4, 0x8d},
50 {0x60, 0xec, 0x31, 0xda, 0x25, 0x07, 0x02, 0x14, 0x84, 0x44, 0x96, 0xa6,
51 0x04, 0x81, 0xca, 0x4e},
52 {0x96, 0x4c, 0xa4, 0x07, 0xee, 0x1c, 0xd1, 0xfb},
53 {0x83, 0x8a, 0xef, 0x18, 0x53, 0x96, 0xec, 0xf3, 0xf4, 0xd9, 0xe8, 0x4b,
54 0x2c, 0x3f, 0xe7, 0x27},
55 {0xad, 0x78, 0x70, 0x06, 0x2e, 0x5e, 0xa5, 0x21,
56 0xdd, 0xe8, 0xa0, 0xb9, 0xdb, 0x0c, 0x81, 0x1d,
57 0x0a, 0xd3, 0xa9, 0x63, 0x78, 0xac, 0x82, 0x64},
58 {0x43, 0x2f, 0xf3, 0x23, 0xf4, 0x5c, 0xbf, 0x05, 0x53, 0x3c, 0x9e, 0xd6,
59 0xd3, 0xd2, 0xc0, 0xf0},
64 unsigned test_num = 0;
70 int out_bytes, final_bytes;
72 bssl::ScopedEVP_CIPHER_CTX
ctx;
77 sizeof(
test.plaintext)));
79 EXPECT_EQ(
static_cast<size_t>(out_bytes + final_bytes),
80 sizeof(
test.plaintext));
83 bssl::ScopedEVP_CIPHER_CTX decrypt_ctx;
90 sizeof(
test.ecb_ciphertext)));
93 EXPECT_EQ(
static_cast<size_t>(out_bytes + final_bytes),
94 sizeof(
test.plaintext));
100 unsigned test_num = 0;
106 int out_bytes, final_bytes;
108 bssl::ScopedEVP_CIPHER_CTX
ctx;
112 sizeof(
test.plaintext)));
114 EXPECT_EQ(
static_cast<size_t>(out_bytes + final_bytes),
115 sizeof(
test.cbc_ciphertext));
118 bssl::ScopedEVP_CIPHER_CTX decrypt_ctx;
123 sizeof(
test.cbc_ciphertext)));
126 EXPECT_EQ(
static_cast<size_t>(out_bytes + final_bytes),
127 sizeof(
test.plaintext));
133 unsigned test_num = 0;
139 int out_bytes, final_bytes;
141 bssl::ScopedEVP_CIPHER_CTX
ctx;
145 sizeof(
test.plaintext)));
147 EXPECT_EQ(
static_cast<size_t>(out_bytes + final_bytes),
148 sizeof(
test.plaintext));
151 bssl::ScopedEVP_CIPHER_CTX decrypt_ctx;
156 sizeof(
test.cfb_ciphertext)));
159 EXPECT_EQ(
static_cast<size_t>(out_bytes + final_bytes),
160 sizeof(
test.plaintext));