Ejemplo n.º 1
0
    void accumQuery(const BlockVector<G1>& query,
                    const BlockVector<Fr>& scalar,
                    ProgressCallback* callback = nullptr)
    {
#ifdef USE_ASSERT
        assert(query.space() == scalar.space() &&
               query.block() == scalar.block());
#endif

        accumQuery(query.vec(),
                   scalar.vec(),
                   callback);
    }
Ejemplo n.º 2
0
    void accumQuery(const BlockVector<G1>& query,
                    const std::size_t reserveTune,
                    ProgressCallback* callback = nullptr)
    {
        std::size_t startOffset = 0;

        if (0 == query.block()[0]) {
#ifdef USE_ASSERT
            assert(query.size() >= 4);
#endif

            m_val = m_val
                + (*m_random_d1) * query[0]
                + (*m_random_d2) * query[1]
                + (*m_random_d3) * query[2]
                + query[3];

            startOffset = 4;
        }

        m_val = m_val + multiExp01(
            query,
            startOffset,
            4,
            *m_witness,
            0 == reserveTune ? reserveTune : (query.size() - startOffset) / reserveTune,
            callback);
    }
Ejemplo n.º 3
0
    // must accumulate all blocks
    void accumVector(const BlockVector<T>& At,
                     const BlockVector<T>& Bt,
                     const BlockVector<T>& Ct) {
#ifdef USE_ASSERT
        assert(At.space() == Bt.space() &&
               Bt.space() == Ct.space() &&
               At.block() == Bt.block() &&
               Bt.block() == Ct.block());
#endif

        for (std::size_t i = At.startIndex(); i < At.stopIndex(); ++i) {
            m_vec[i] =
                m_random_beta_rA * At[i] +
                m_random_beta_rB * Bt[i] +
                m_random_beta_rC * Ct[i];
        }
    }
Ejemplo n.º 4
0
 PPZK_QueryHK(const BlockVector<Fr>& qap_query)
     : PPZK_QueryHK{qap_query.space(), qap_query.block()[0]}
 {}