// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x990, %rsp            # imm = 0x990
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
addw $0x1, %cx
movw %cx, (%rax)
leaq -0x70(%rbp), %rdi
leaq 0x37a68(%rip), %rsi     # 0x42270
movl $0x60, %edx
callq 0x10c0
leaq -0x908(%rbp), %rdi
xorl %esi, %esi
movl $0x898, %edx            # imm = 0x898
callq 0x1090
leaq -0x70(%rbp), %rsi
leaq -0x908(%rbp), %rdi
movl $0x60, %edx
xorl %ecx, %ecx
callq 0x1c6e0
leaq -0x958(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x1090
leaq -0x958(%rbp), %rdi
callq 0x1d370
movl $0x1, -0x958(%rbp)
movl $0x3, -0x954(%rbp)
movl $0x4, -0x950(%rbp)
leaq -0x968(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x968(%rbp), %rdi
callq 0x1d330
movl $0xe, -0x968(%rbp)
leaq -0x958(%rbp), %rax
movq %rax, -0x960(%rbp)
leaq -0x978(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x1090
leaq -0x978(%rbp), %rdi
callq 0x1d330
leaq -0x908(%rbp), %rdi
leaq -0x978(%rbp), %rsi
callq 0x2f0a0
movl %eax, -0x97c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x988(%rbp)
leaq -0x968(%rbp), %rdi
leaq -0x978(%rbp), %rsi
callq 0x20f80
movq -0x988(%rbp), %rdi
movl %eax, %edx
movl -0x97c(%rbp), %ecx
leaq -0x908(%rbp), %rsi
leaq 0x353bb(%rip), %r8      # 0x3fcde
callq 0x13a0
movl %eax, -0x97c(%rbp)
leaq -0x908(%rbp), %rdi
leaq -0x978(%rbp), %rsi
callq 0x1d8e0
leaq -0x908(%rbp), %rdi
callq 0x1cab0
movl -0x97c(%rbp), %eax
addq $0x990, %rsp            # imm = 0x990
popq %rbp
retq
nopl (%rax)