using System; using System.Globalization; using System.Numerics; namespace ln.crypto.ec { public static class Extensions { public static T[] Segment(this T[] a,int start) => Segment(a, start, a.Length); public static T[] Segment(this T[] a,int start, int length) { T[] r = new T[length]; Array.Copy(a, start, r, 0, length > a.Length ? a.Length : length); return r; } public static byte[] GetBytes(this uint[] a) { byte[] r = new byte[a.Length * 4]; for (int n=0;n(T[] a) { T[] r = (T[])a.Clone(); Array.Reverse(r); return r; } public static int CreateHashCode(this byte[] bytes) { int hash = 0x22447799; foreach (byte by in bytes) hash *= by; return hash; } } }