소스 검색

System.Core: Use ECCurve & friends from CoreFX. (#9536)

* Use ECCurve & friends from CoreFX.

* [csproj] Update project files

* Bump API snapshot submodule
Filip Navara 7 년 전
부모
커밋
94dc6098e3

+ 1 - 1
external/api-snapshot

@@ -1 +1 @@
-Subproject commit 625a31c1ba2e6b8422e1157b0047e8fcd89a4237
+Subproject commit 6ef6bbeb5441c68c2c8bd9bbcfc075bf5aee097c

+ 5 - 3
mcs/class/System.Core/System.Core.csproj

@@ -449,6 +449,11 @@
     <Compile Include="..\..\..\external\corefx\src\System.Linq\src\System\Linq\Utilities.cs" />
     <Compile Include="..\..\..\external\corefx\src\System.Linq\src\System\Linq\Where.cs" />
     <Compile Include="..\..\..\external\corefx\src\System.Linq\src\System\Linq\Zip.cs" />
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Algorithms\src\System\Security\Cryptography\ECCurve.ECCurveType.cs" />
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Algorithms\src\System\Security\Cryptography\ECCurve.NamedCurves.cs" />
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Algorithms\src\System\Security\Cryptography\ECCurve.cs" />
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Algorithms\src\System\Security\Cryptography\ECParameters.cs" />
+    <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Algorithms\src\System\Security\Cryptography\ECPoint.cs" />
     <Compile Include="..\..\..\external\corefx\src\System.Security.Cryptography.Algorithms\src\System\Security\Cryptography\IncrementalHash.net46.cs" />
     <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />
     <Compile Include="..\..\build\common\SR.cs" />
@@ -516,9 +521,6 @@
     <Compile Include="System.Security.Cryptography.X509Certificates\ECDsaCertificateExtensions.cs" />
     <Compile Include="System.Security.Cryptography.X509Certificates\RSACertificateExtensions.cs" />
     <Compile Include="System.Security.Cryptography\AesCng.cs" />
-    <Compile Include="System.Security.Cryptography\ECCurve.cs" />
-    <Compile Include="System.Security.Cryptography\ECParameters.cs" />
-    <Compile Include="System.Security.Cryptography\ECPoint.cs" />
     <Compile Include="System.Security.Cryptography\SHA256CryptoServiceProvider.cs" />
     <Compile Include="System.Security.Cryptography\SHA384CryptoServiceProvider.cs" />
     <Compile Include="System.Security.Cryptography\SHA512CryptoServiceProvider.cs" />

+ 0 - 85
mcs/class/System.Core/System.Security.Cryptography/ECCurve.cs

@@ -1,85 +0,0 @@
-//
-// ECCurve.cs
-//
-// Authors:
-//	Marek Safar  <[email protected]>
-//
-// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography
-{
-	[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
-	public struct ECCurve
-	{
-		public byte[] A;
-		public byte[] B;
-		public byte[] Cofactor;
-		public ECCurveType CurveType;
-		public ECPoint G;
-		public HashAlgorithmName? Hash;
-		public byte[] Order;
-		public byte[] Polynomial;
-		public byte[] Prime;
-		public byte[] Seed;
-		public bool IsCharacteristic2 { get { throw new NotImplementedException (); } }
-		public bool IsExplicit { get { throw new NotImplementedException (); } }
-		public bool IsNamed { get { throw new NotImplementedException (); } }
-		public bool IsPrime { get { throw new NotImplementedException (); } }
-		public Oid Oid { get { throw new NotImplementedException (); } }
-		public static ECCurve CreateFromFriendlyName (string oidFriendlyName) { throw new NotImplementedException (); }
-		public static ECCurve CreateFromOid (Oid curveOid) { throw new NotImplementedException (); }
-		public static ECCurve CreateFromValue (string oidValue) { throw new NotImplementedException (); }
-		public void Validate () { throw new NotImplementedException (); }
-
-		public enum ECCurveType
-		{
-			Implicit = 0,
-			PrimeShortWeierstrass = 1,
-			PrimeTwistedEdwards = 2,
-			PrimeMontgomery = 3,
-			Characteristic2 = 4,
-			Named = 5,
-		}
-		
-		public static class NamedCurves
-		{
-			public static ECCurve brainpoolP160r1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP160t1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP192r1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP192t1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP224r1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP224t1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP256r1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP256t1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP320r1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP320t1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP384r1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP384t1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP512r1 { get { throw new NotImplementedException (); } }
-			public static ECCurve brainpoolP512t1 { get { throw new NotImplementedException (); } }
-			public static ECCurve nistP256 { get { throw new NotImplementedException (); } }
-			public static ECCurve nistP384 { get { throw new NotImplementedException (); } }
-			public static ECCurve nistP521 { get { throw new NotImplementedException (); } }
-		}
-	}
-}

+ 0 - 39
mcs/class/System.Core/System.Security.Cryptography/ECParameters.cs

@@ -1,39 +0,0 @@
-//
-// ECPArameters.cs
-//
-// Authors:
-//	Marek Safar  <[email protected]>
-//
-// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography
-{
-    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
-    public partial struct ECParameters
-    {
-        public ECCurve Curve;
-        public byte[] D;
-        public ECPoint Q;
-        public void Validate () { throw new NotImplementedException (); }
-    }
-}

+ 0 - 37
mcs/class/System.Core/System.Security.Cryptography/ECPoint.cs

@@ -1,37 +0,0 @@
-//
-// ECPoint.cs
-//
-// Authors:
-//	Marek Safar  <[email protected]>
-//
-// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-namespace System.Security.Cryptography
-{
-	[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
-	public struct ECPoint
-	{
-		public byte[] X;
-		public byte[] Y;
-	}
-}

+ 5 - 3
mcs/class/System.Core/common_System.Core.dll.sources

@@ -82,9 +82,11 @@ corefx/SR.missing.cs
 
 System.Runtime.InteropServices/ComAwareEventInfo.cs
 
-System.Security.Cryptography/ECCurve.cs
-System.Security.Cryptography/ECPoint.cs
-System.Security.Cryptography/ECParameters.cs
+../../../external/corefx/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.cs
+../../../external/corefx/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.ECCurveType.cs
+../../../external/corefx/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECCurve.NamedCurves.cs
+../../../external/corefx/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECPoint.cs
+../../../external/corefx/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/ECParameters.cs
 System.Security.Cryptography/SHA256CryptoServiceProvider.cs
 System.Security.Cryptography/SHA384CryptoServiceProvider.cs
 System.Security.Cryptography/SHA512CryptoServiceProvider.cs