static int srp_Verify_N_and_g(const BIGNUM *N, const BIGNUM *g)
{
    BN_CTX *bn_ctx = BN_CTX_new();
    BIGNUM *p = BN_new();
    BIGNUM *r = BN_new();
    int ret =
        g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) &&
        BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) &&
        p != NULL && BN_rshift1(p, N) &&
        BN_is_prime_ex(p, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) &&
        r != NULL &&
        BN_mod_exp(r, g, p, N, bn_ctx) &&
        BN_add_word(r, 1) && BN_cmp(r, N) == 0;
    BN_free(r);
    BN_free(p);
    BN_CTX_free(bn_ctx);
    return ret;
}
['static int srp_Verify_N_and_g(const BIGNUM *N, const BIGNUM *g)\n{\n    BN_CTX *bn_ctx = BN_CTX_new();\n    BIGNUM *p = BN_new();\n    BIGNUM *r = BN_new();\n    int ret =\n        g != NULL && N != NULL && bn_ctx != NULL && BN_is_odd(N) &&\n        BN_is_prime_ex(N, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) &&\n        p != NULL && BN_rshift1(p, N) &&\n        BN_is_prime_ex(p, SRP_NUMBER_ITERATIONS_FOR_PRIME, bn_ctx, NULL) &&\n        r != NULL &&\n        BN_mod_exp(r, g, p, N, bn_ctx) &&\n        BN_add_word(r, 1) && BN_cmp(r, N) == 0;\n    BN_free(r);\n    BN_free(p);\n    BN_CTX_free(bn_ctx);\n    return ret;\n}', 'BN_CTX *BN_CTX_new(void)\n{\n    BN_CTX *ret;\n    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {\n        BNerr(BN_F_BN_CTX_NEW, ERR_R_MALLOC_FAILURE);\n        return NULL;\n    }\n    BN_POOL_init(&ret->pool);\n    BN_STACK_init(&ret->stack);\n    return ret;\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}', 'static void BN_POOL_init(BN_POOL *p)\n{\n    p->head = p->current = p->tail = NULL;\n    p->used = p->size = 0;\n}', 'static void BN_STACK_init(BN_STACK *st)\n{\n    st->indexes = NULL;\n    st->depth = st->size = 0;\n}', 'BIGNUM *BN_new(void)\n{\n    BIGNUM *ret;\n    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) {\n        BNerr(BN_F_BN_NEW, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    ret->flags = BN_FLG_MALLOCED;\n    bn_check_top(ret);\n    return (ret);\n}', 'int BN_is_odd(const BIGNUM *a)\n{\n    return (a->top > 0) && (a->d[0] & 1);\n}', 'void BN_free(BIGNUM *a)\n{\n    if (a == NULL)\n        return;\n    bn_check_top(a);\n    if (!BN_get_flags(a, BN_FLG_STATIC_DATA))\n        bn_free_d(a);\n    if (a->flags & BN_FLG_MALLOCED)\n        OPENSSL_free(a);\n    else {\n#if OPENSSL_API_COMPAT < 0x00908000L\n        a->flags |= BN_FLG_FREE;\n#endif\n        a->d = NULL;\n    }\n}', 'int BN_get_flags(const BIGNUM *b, int n)\n{\n    return b->flags & n;\n}']