static unsigned int U8TOU32(const unsigned char *p)
{
    return (((unsigned int)(p[0] & 0xff)) |
            ((unsigned int)(p[1] & 0xff) << 8) |
            ((unsigned int)(p[2] & 0xff) << 16) |
            ((unsigned int)(p[3] & 0xff) << 24));
}
['static int pkey_poly1305_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)\n{\n    POLY1305_PKEY_CTX *pctx = EVP_PKEY_CTX_get_data(ctx);\n    const unsigned char *key;\n    size_t len;\n    switch (type) {\n    case EVP_PKEY_CTRL_MD:\n        break;\n    case EVP_PKEY_CTRL_SET_MAC_KEY:\n    case EVP_PKEY_CTRL_DIGESTINIT:\n        if (type == EVP_PKEY_CTRL_SET_MAC_KEY) {\n            key = p2;\n            len = p1;\n        } else {\n            key = EVP_PKEY_get0_poly1305(EVP_PKEY_CTX_get0_pkey(ctx), &len);\n        }\n        if (key == NULL || len != POLY1305_KEY_SIZE ||\n            !ASN1_OCTET_STRING_set(&pctx->ktmp, key, len))\n            return 0;\n        Poly1305_Init(&pctx->ctx, ASN1_STRING_get0_data(&pctx->ktmp));\n        break;\n    default:\n        return -2;\n    }\n    return 1;\n}', 'int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *x, const unsigned char *d,\n                          int len)\n{\n    return ASN1_STRING_set(x, d, len);\n}', "int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len)\n{\n    unsigned char *c;\n    const char *data = _data;\n    if (len < 0) {\n        if (data == NULL)\n            return (0);\n        else\n            len = strlen(data);\n    }\n    if ((str->length <= len) || (str->data == NULL)) {\n        c = str->data;\n        str->data = OPENSSL_realloc(c, len + 1);\n        if (str->data == NULL) {\n            ASN1err(ASN1_F_ASN1_STRING_SET, ERR_R_MALLOC_FAILURE);\n            str->data = c;\n            return (0);\n        }\n    }\n    str->length = len;\n    if (data != NULL) {\n        memcpy(str->data, data, len);\n        str->data[len] = '\\0';\n    }\n    return (1);\n}", 'const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x)\n{\n    return x->data;\n}', 'void Poly1305_Init(POLY1305 *ctx, const unsigned char key[32])\n{\n    ctx->nonce[0] = U8TOU32(&key[16]);\n    ctx->nonce[1] = U8TOU32(&key[20]);\n    ctx->nonce[2] = U8TOU32(&key[24]);\n    ctx->nonce[3] = U8TOU32(&key[28]);\n#ifndef POLY1305_ASM\n    poly1305_init(ctx->opaque, key);\n#else\n    if (!poly1305_init(ctx->opaque, key, &ctx->func)) {\n        ctx->func.blocks = poly1305_blocks;\n        ctx->func.emit = poly1305_emit;\n    }\n#endif\n    ctx->num = 0;\n}', 'static unsigned int U8TOU32(const unsigned char *p)\n{\n    return (((unsigned int)(p[0] & 0xff)) |\n            ((unsigned int)(p[1] & 0xff) << 8) |\n            ((unsigned int)(p[2] & 0xff) << 16) |\n            ((unsigned int)(p[3] & 0xff) << 24));\n}']