Example #1
0
 /// <summary>
 /// Decodes a <see cref="ECPoint" /> instance from a byte buffer.
 /// </summary>
 /// <param name="ecGroupHandle">Native handle for the group the point lies on.</param>
 /// <param name="buffer">Byte array containing an encoding of the curve point.</param>
 /// <returns><see cref="ECPoint" /> instance of the point encoded in the buffer.</returns>
 internal static ECPoint CreateFromBytes(ECGroupHandle ecGroupHandle, byte[] buffer)
 {
     using (var ctx = BigNumberContextHandle.Create())
     {
         var point = new ECPoint(ecGroupHandle);
         ECPointHandle.FromByteBuffer(point._ecGroup, point.Handle, buffer, ctx);
         return(point);
     }
 }