void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)
{
	CRYPTO_gcm128_finish(ctx, NULL, 0);
	memcpy(tag, ctx->Xi.c, len<=sizeof(ctx->Xi.c)?len:sizeof(ctx->Xi.c));
}
['static int aes_gcm(EVP_CIPHER_CTX *ctx, unsigned char *out,\n\t\tconst unsigned char *in, size_t len)\n\t{\n\tEVP_AES_GCM_CTX *gctx = ctx->cipher_data;\n\tif (!gctx->iv_set && !gctx->key_set)\n\t\treturn -1;\n\tif (!ctx->encrypt && gctx->taglen < 0)\n\t\treturn -1;\n\tif (in)\n\t\t{\n\t\tif (out == NULL)\n\t\t\t{\n\t\t\tif (CRYPTO_gcm128_aad(gctx->gcm, in, len))\n\t\t\t\treturn -1;\n\t\t\t}\n\t\telse if (ctx->encrypt)\n\t\t\t{\n\t\t\tif (CRYPTO_gcm128_encrypt(gctx->gcm, in, out, len))\n\t\t\t\treturn -1;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (CRYPTO_gcm128_decrypt(gctx->gcm, in, out, len))\n\t\t\t\treturn -1;\n\t\t\t}\n\t\treturn len;\n\t\t}\n\telse\n\t\t{\n\t\tif (!ctx->encrypt)\n\t\t\t{\n\t\t\tif (CRYPTO_gcm128_finish(gctx->gcm,\n\t\t\t\t\tgctx->tag, gctx->taglen) != 0)\n\t\t\t\treturn -1;\n\t\t\tgctx->iv_set = 0;\n\t\t\treturn 0;\n\t\t\t}\n\t\tCRYPTO_gcm128_tag(gctx->gcm, gctx->tag, 16);\n\t\tgctx->taglen = 16;\n\t\tgctx->iv_set = 0;\n\t\treturn 0;\n\t\t}\n\t}', 'void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len)\n{\n\tCRYPTO_gcm128_finish(ctx, NULL, 0);\n\tmemcpy(tag, ctx->Xi.c, len<=sizeof(ctx->Xi.c)?len:sizeof(ctx->Xi.c));\n}']