static char *print_mem_maybe_null(const void *s, size_t n,
                                  char outbuf[MEM_BUFFER_SIZE])
{
    size_t i;
    const unsigned char *p = (const unsigned char *)s;
    char *out = outbuf;
    int pad = 2 * n >= MEM_BUFFER_SIZE;
    if (s == NULL)
        return strcpy(outbuf, "(NULL)");
    if (pad) {
        if ((out = OPENSSL_malloc(2 * n + 1)) == NULL) {
            out = outbuf;
            n = (MEM_BUFFER_SIZE - 4) / 2;
        } else {
            pad = 0;
        }
    }
    for (i = 0; i < 2 * n; ) {
        const unsigned char c = *p++;
        out[i++] = "0123456789abcdef"[c >> 4];
        out[i++] = "0123456789abcdef"[c & 15];
    }
    if (pad) {
        out[i++] = '.';
        out[i++] = '.';
        out[i++] = '.';
    }
    out[i] = '\0';
    return out;
}
['static int test_ige_dec_chaining(void)\n{\n    AES_KEY key;\n    unsigned char iv[AES_BLOCK_SIZE * 4];\n    unsigned char ciphertext[BIG_TEST_SIZE];\n    unsigned char checktext[BIG_TEST_SIZE];\n    AES_set_encrypt_key(rkey, 8 * sizeof rkey, &key);\n    memcpy(iv, saved_iv, sizeof iv);\n    AES_ige_encrypt(plaintext, ciphertext, TEST_SIZE / 2, &key, iv,\n                    AES_ENCRYPT);\n    AES_ige_encrypt(plaintext + TEST_SIZE / 2,\n                    ciphertext + TEST_SIZE / 2, TEST_SIZE / 2,\n                    &key, iv, AES_ENCRYPT);\n    AES_set_decrypt_key(rkey, 8 * sizeof rkey, &key);\n    memcpy(iv, saved_iv, sizeof iv);\n    AES_ige_encrypt(ciphertext, checktext, TEST_SIZE / 2, &key, iv,\n                    AES_DECRYPT);\n    AES_ige_encrypt(ciphertext + TEST_SIZE / 2,\n                    checktext + TEST_SIZE / 2, TEST_SIZE / 2, &key, iv,\n                    AES_DECRYPT);\n    return TEST_mem_eq(checktext, TEST_SIZE, plaintext, TEST_SIZE);\n}', 'int test_mem_eq(const char *file, int line, const char *st1, const char *st2,\n                const void *s1, size_t n1, const void *s2, size_t n2)\n{\n    char b1[MEM_BUFFER_SIZE], b2[MEM_BUFFER_SIZE];\n    if (s1 == NULL && s2 == NULL)\n        return 1;\n    if (n1 != n2 || s1 == NULL || s2 == NULL || memcmp(s1, s2, n1) != 0) {\n        char *m1 = print_mem_maybe_null(s1, n1, b1);\n        char *m2 = print_mem_maybe_null(s2, n2, b2);\n        test_fail_message(NULL, file, line, "memory",\n                          "%s %s [%zu] == %s %s [%zu]",\n                          st1, m1, n1, st2, m2, n2);\n        if (m1 != b1)\n            OPENSSL_free(m1);\n        if (m2 != b2)\n            OPENSSL_free(m2);\n        return 0;\n    }\n    return 1;\n}', 'static char *print_mem_maybe_null(const void *s, size_t n,\n                                  char outbuf[MEM_BUFFER_SIZE])\n{\n    size_t i;\n    const unsigned char *p = (const unsigned char *)s;\n    char *out = outbuf;\n    int pad = 2 * n >= MEM_BUFFER_SIZE;\n    if (s == NULL)\n        return strcpy(outbuf, "(NULL)");\n    if (pad) {\n        if ((out = OPENSSL_malloc(2 * n + 1)) == NULL) {\n            out = outbuf;\n            n = (MEM_BUFFER_SIZE - 4) / 2;\n        } else {\n            pad = 0;\n        }\n    }\n    for (i = 0; i < 2 * n; ) {\n        const unsigned char c = *p++;\n        out[i++] = "0123456789abcdef"[c >> 4];\n        out[i++] = "0123456789abcdef"[c & 15];\n    }\n    if (pad) {\n        out[i++] = \'.\';\n        out[i++] = \'.\';\n        out[i++] = \'.\';\n    }\n    out[i] = \'\\0\';\n    return out;\n}']