// File: /workspace/github_c_makefile_star2_O1/OpenKMIP[P]libkmip/tests/tests.c
// Function: test_decode_attribute_cryptographic_parameters
int
test_decode_attribute_cryptographic_parameters(TestTracker *tracker)
{
    TRACK_TEST(tracker);

    /* This encoding matches the following values:
    *  Attribute
    *      Attribute Name - Cryptographic Parameters
    *      Attribute Value
    *          Block Cipher Mode - CBC
    *          Padding Method - PKCS5
    *          Hashing Algorithm - SHA-1
    */
    uint8 encoding[96] = {
        0x42, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x58,
        0x42, 0x00, 0x0A, 0x07, 0x00, 0x00, 0x00, 0x18,
        0x43, 0x72, 0x79, 0x70, 0x74, 0x6F, 0x67, 0x72,
        0x61, 0x70, 0x68, 0x69, 0x63, 0x20, 0x50, 0x61,
        0x72, 0x61, 0x6D, 0x65, 0x74, 0x65, 0x72, 0x73,
        0x42, 0x00, 0x0B, 0x01, 0x00, 0x00, 0x00, 0x30,
        0x42, 0x00, 0x11, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x5F, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
        0x42, 0x00, 0x38, 0x05, 0x00, 0x00, 0x00, 0x04,
        0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00
    };

    KMIP ctx = {0};
    kmip_init(&ctx, encoding, ARRAY_LENGTH(encoding), KMIP_1_0);

    CryptographicParameters value = {0};
    kmip_init_cryptographic_parameters(&value);
    value.block_cipher_mode = KMIP_BLOCK_CBC;
    value.padding_method = KMIP_PAD_PKCS5;
    value.hashing_algorithm = KMIP_HASH_SHA1;

    Attribute expected = {0};
    kmip_init_attribute(&expected);
    expected.type = KMIP_ATTR_CRYPTOGRAPHIC_PARAMETERS;
    expected.value = &value;

    Attribute observed = {0};
    kmip_init_attribute(&observed);

    int result = kmip_decode_attribute(&ctx, &observed);
    result = report_decoding_test_result(
        tracker,
        &ctx,
        kmip_compare_attribute(&expected, &observed),
        result,
        __func__
    );
    kmip_free_attribute(&ctx, &observed);
    kmip_destroy(&ctx);
    return(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x970, %rsp            # imm = 0x970
movq %rdi, %r14
incw (%rdi)
leaq 0x2a622(%rip), %rsi     # 0x31f10
leaq 0x70(%rsp), %r15
movl $0xc, %ecx
movq %r15, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xd8(%rsp), %rbx
movl $0x898, %edx            # imm = 0x898
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10c0
movl $0x60, %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %ecx, %ecx
callq 0x13747
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r15
movaps %xmm0, 0x40(%r15)
movaps %xmm0, 0x30(%r15)
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movq %r15, %rdi
callq 0x13e74
movabsq $0x300000001, %rax      # imm = 0x300000001
movq %rax, (%r15)
movl $0x4, 0x8(%r15)
leaq 0x10(%rsp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, (%r12)
movq %r12, %rdi
callq 0x13e59
movl $0xe, (%r12)
movq %r15, 0x8(%r12)
movq %rsp, %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movq %r15, %rdi
callq 0x13e59
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2050d
movl %eax, %ebp
movq %r12, %rdi
movq %r15, %rsi
callq 0x163c1
leaq 0x283df(%rip), %r8      # 0x2fd96
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
movl %ebp, %ecx
callq 0x1397
movl %eax, %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq 0x140cc
movq %rbx, %rdi
callq 0x13a23
movl %ebp, %eax
addq $0x970, %rsp            # imm = 0x970
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq