public virtual ECPoint Lookup(int index) { int m = m_outer.m; int[] ks = m_outer.IsTrinomial() ? new int[] { m_outer.k1 } : new int[] { m_outer.k1, m_outer.k2, m_outer.k3 }; int FE_LONGS = (m_outer.m + 63) / 64; long[] x = new long[FE_LONGS], y = new long[FE_LONGS]; int pos = 0; for (int i = 0; i < m_size; ++i) { long MASK = ((i ^ index) - 1) >> 31; for (int j = 0; j < FE_LONGS; ++j) { x[j] ^= m_table[pos + j] & MASK; y[j] ^= m_table[pos + FE_LONGS + j] & MASK; } pos += (FE_LONGS * 2); } ECFieldElement X = new F2mFieldElement(m, ks, new LongArray(x)); ECFieldElement Y = new F2mFieldElement(m, ks, new LongArray(y)); return(m_outer.CreateRawPoint(X, Y, false)); }
private ECPoint CreatePoint(long[] x, long[] y) { int m = m_outer.m; int[] ks = m_outer.IsTrinomial() ? new int[] { m_outer.k1 } : new int[] { m_outer.k1, m_outer.k2, m_outer.k3 }; ECFieldElement X = new F2mFieldElement(m, ks, new LongArray(x)); ECFieldElement Y = new F2mFieldElement(m, ks, new LongArray(y)); return(m_outer.CreateRawPoint(X, Y, false)); }