Esempio n. 1
0
        public unsafe static int EC_POINT_point2oct(EC_GROUP group, EC_POINT point, EC_POINT_CONVERSION form, Span <byte> output)
        {
            var size = EC_POINT_point2oct(group, point, form, null, IntPtr.Zero, IntPtr.Zero);

            if (size.ToInt32() > output.Length)
            {
                throw new ArgumentOutOfRangeException(nameof(output));
            }
            ThrowOnError(size);
            fixed(void *outputPtr = &output.DangerousGetPinnableReference())
            {
                size = EC_POINT_point2oct(group, point, form, outputPtr, (IntPtr)output.Length, IntPtr.Zero);
                ThrowOnError(size);
                return(size.ToInt32());
            }
        }
Esempio n. 2
0
 private static extern unsafe IntPtr EC_POINT_point2oct(EC_GROUP group, EC_POINT p, EC_POINT_CONVERSION form, void *buf, IntPtr len, IntPtr ctx);
 internal static extern unsafe int EC_POINT_oct2point(EC_GROUP group, EC_POINT p, void *buf, IntPtr len, void *ctx);
 internal static extern int EC_KEY_set_public_key(EC_KEY key, EC_POINT point);
Esempio n. 5
0
        public static void EC_KEY_set_public_key(EC_KEY key, EC_POINT point)
        {
            var result = Internal_EC_KEY_set_public_key(key, point);

            ThrowOnErrorReturnCode(result);
        }
Esempio n. 6
0
 private static extern int Internal_EC_KEY_set_public_key(EC_KEY key, EC_POINT point);