Ejemplo n.º 1
0
            public virtual ECPoint Lookup(int index)
            {
                uint[] x   = Nat.Create(SECP384R1_FE_INTS), y = Nat.Create(SECP384R1_FE_INTS);
                int    pos = 0;

                for (int i = 0; i < m_size; ++i)
                {
                    uint MASK = (uint)(((i ^ index) - 1) >> 31);

                    for (int j = 0; j < SECP384R1_FE_INTS; ++j)
                    {
                        x[j] ^= m_table[pos + j] & MASK;
                        y[j] ^= m_table[pos + SECP384R1_FE_INTS + j] & MASK;
                    }

                    pos += (SECP384R1_FE_INTS * 2);
                }

                return(m_outer.CreateRawPoint(new SecP384R1FieldElement(x), new SecP384R1FieldElement(y), false));
            }
Ejemplo n.º 2
0
 private ECPoint CreatePoint(uint[] x, uint[] y)
 {
     return(m_outer.CreateRawPoint(new SecP384R1FieldElement(x), new SecP384R1FieldElement(y), SECP384R1_AFFINE_ZS, false));
 }