Go to the documentation of this file.
23 #include "../crypto/test/file_test.h"
24 #include "../crypto/test/test_util.h"
38 const std::vector<uint8_t> &
key,
39 const std::vector<uint8_t> &
in) {
40 size_t key_bits =
key.size() * 8;
41 if (key_bits != 128 && key_bits != 192 && key_bits != 256) {
47 out->resize(
in.size() + 8);
54 out->resize(
in.size() - 8);
66 const std::vector<uint8_t> &
key,
67 const std::vector<uint8_t> &
in) {
68 const size_t key_bits =
key.size() * 8;
69 if (key_bits != 128 && key_bits != 192 && key_bits != 256) {
76 out->resize(
in.size() + 15);
79 in.data(),
in.size())) {
83 out->resize(
in.size());
86 in.data(),
in.size())) {
96 TestCtx *
ctx =
reinterpret_cast<TestCtx *
>(
arg);
99 result_label =
ctx->encrypt ?
"C" :
"P";
102 if (!t->GetInstruction(&unused,
"PLAINTEXT LENGTH") ||
103 !t->GetAttribute(&
count,
"COUNT") ||
104 !t->GetBytes(&
key,
"K") ||
105 !t->GetBytes(&
in, in_label)) {
115 printf(
"%s", t->CurrentTestToString().c_str());
132 "usage: %s (enc|dec|enc-pad|dec-pad) (128|192|256) <test file>\n",
139 return usage(argv[0]);
143 bool encrypt =
false;
144 bool padding =
false;
147 }
else if (
op ==
"dec") {
148 }
else if (
op ==
"enc-pad") {
151 }
else if (
op ==
"dec-pad") {
154 return usage(argv[0]);
157 TestCtx
ctx = {encrypt, padding};
#define AES_set_encrypt_key
int FileTestMain(FileTestFunc run_test, void *arg, const char *path)
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
static struct test_ctx ctx
def c_str(s, encoding='ascii')
std::string EncodeHex(bssl::Span< const uint8_t > in)
#define AES_unwrap_key_padded
void EchoComment(const std::string &comment)
static bool AESKeyWrap(std::vector< uint8_t > *out, bool encrypt, const std::vector< uint8_t > &key, const std::vector< uint8_t > &in)
#define AES_set_decrypt_key
static int usage(char *arg)
static bool AESKeyWrapWithPadding(std::vector< uint8_t > *out, bool encrypt, const std::vector< uint8_t > &key, const std::vector< uint8_t > &in)
int cavp_keywrap_test_main(int argc, char **argv)
static bool TestCipher(FileTest *t, void *arg)
#define AES_wrap_key_padded
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:52